Skip to content

docs: add ESLint rule exception for react/no-children-prop #1413

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KwibooReese
Copy link

I ran into an error caused by ESLint and I have found that a few other people did too, I think it would be good to include this in the docs.

I ran into some errors caused by ESLint and I have found that a few other people did too, I think it would be good to include this in the docs.
@Pascalmh
Copy link
Contributor

Thoughts:

  • you do not have to write the code the same as in the docs/examples - you can keep the eslint-rule turned on
  • it is just one linting tool, would the docs end up listing all?
  • the rule is disabled in the tanstack-form repo - i would prefer if the same setting was set for the rule

@LeCarbonator
Copy link
Contributor

This is mostly preference and unrelated to tanstack form.

// These writing styles are equivalent in React
<Component children={(foo) => <Bar/>} />

<Component>
  {(foo) => <Bar/>}
</Component>

I think it's fine to add docs explaining this as I have seen others ask about it too.
However, I think specifically targeting ESLint "erroring" is overkill. It's up to the user to decide if they want to enforce a certain way to write children functions or not.

@KwibooReese
Copy link
Author

I changed the wording to mention

This is mostly preference and unrelated to tanstack form.

// These writing styles are equivalent in React
<Component children={(foo) => <Bar/>} />

<Component>
  {(foo) => <Bar/>}
</Component>

I think it's fine to add docs explaining this as I have seen others ask about it too. However, I think specifically targeting ESLint "erroring" is overkill. It's up to the user to decide if they want to enforce a certain way to write children functions or not.

I've reworded the original commit, let me know what you think. It could be good to add what you put in that message into the docs:

<Component>
  {(foo) => <Bar/>}
</Component>

I don't think it's entirely necessary to these proposed changes, but it would be helpful for newer devs.

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

Successfully merging this pull request may close these issues.

3 participants