Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createI13nNode components accept unused i13n prop #565

Open
chrissantamaria opened this issue Mar 17, 2023 · 2 comments
Open

createI13nNode components accept unused i13n prop #565

chrissantamaria opened this issue Mar 17, 2023 · 2 comments

Comments

@chrissantamaria
Copy link
Contributor

👋 was poking around in this package's internals and noticed that components returned by createI13nNode seemingly accept an i13n prop in addition to i13nModel:

const I13nComponentWrapper = (props) => {
const {
// i13n props
bindClickEvent,
follow,
i13n,
i13nModel,
isLeafNode,
scanLinks,
shouldFollowLink,
children,
...restProps
} = props;

From what I can tell, this is only used to construct i13nProps which is eventually passed to CoreComponent. However, it's seemingly unused in there:

const CoreComponent = (props) => {
const {
bindClickEvent,
componentIsFunction,
children,
follow,
i13nModel,
scanLinks = {},
shouldFollowLink,
viewport,
} = props;

Out of curiosity, is this prop supported / does it functionally do anything? It's not mentioned on the docs for createI13nNode, so I assume it's leftover. If that's the case, I'm happy to take a stab at cleaning it up :)

@redonkulus
Copy link
Contributor

@roderickhsiao any thoughts here?

@roderickhsiao
Copy link
Collaborator

I think it's from migrating from old logic to new one (we support i13n on previous major version), but probably removed in this version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants