#Eslint error - Do not pass children as props. Instead, nest children between the opening and closing

10 messages · Page 1 of 1 (latest)

wicked osprey
#

I'm following the instructions to create a basic react-form but this eslint rule is bothering me. Any ideas?

#

It seems I should turn off this rule

    'react/no-children-prop': 'off',
  },

Is this ok?

civic pilot
vague cypress
#

Also, you can just use the other syntax if you'd like 🙂

wicked osprey
#

@civic pilot thx it worked 🙂

#

@vague cypress could you point me to the other syntax? noob here 🙂

vague cypress
#
<Comp children={() => null}/>

Is the same as:

<Comp>{() => null}</Comp>
civic pilot
civic pilot