#Eslint error - Do not pass children as props. Instead, nest children between the opening and closing
10 messages · Page 1 of 1 (latest)
It seems I should turn off this rule
'react/no-children-prop': 'off',
},
Is this ok?
There's an allowFunctions` option you can set to true.
https://github.com/TanStack/form/blob/main/examples/react/simple/.eslintrc.cjs#L7
That said - in the tanstack/form repo the rule is set to 'off' 😉
Also, you can just use the other syntax if you'd like 🙂
@civic pilot thx it worked 🙂
@vague cypress could you point me to the other syntax? noob here 🙂
<Comp children={() => null}/>
Is the same as:
<Comp>{() => null}</Comp>
For Biome users I opened a discussion to add the allowFunctions option as well - https://github.com/biomejs/biome/discussions/3698
Any reason why Tanstack Forms is using the children-Prop instead of "actual children"?
The eslint rule sounds more like an opinion then an explanation why one is better then the other…