Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GETTING ERROR : Warning: Failed prop type: Invalid prop `children` supplied to `Form`, expected a ReactNode

I am making a simple demo of useContext using final-form.I am getting this warning

Warning: Failed prop type: Invalid propchildrensupplied toForm, expected a ReactNode.

here is my code https://codesandbox.io/s/github/test-gitt

step to reproduce my issue or warning

  1. run the application .A button is displayed . Click on button.it shows another page having a button.
  2. click again the button with console open contrl+alt+I.

you will this warning why ?

<BrowserRouter>
        <LoadingProvider>
            <Router/>
        </LoadingProvider>
    </BrowserRouter>

enter image description here

any update ?

like image 445
user944513 Avatar asked Jan 20 '26 02:01

user944513


1 Answers

From what I was able to test using your provided code, this is what took that error away:

On the following line of code inside src > add-agency > index.js:54

You have to wrap the children of SForm into a Fragment in order for the children to be only one ReactNode. Something like:

<SForm>
    <Fragment>
        <Tag />
        <Tag />
        <Tag />
    </Fragment>
</SForm>

Please consider not posting your entire code base and just write down a simple and reproducible example that can easily show what issue you're trying to figure out.

like image 177
un_vato_ordinario Avatar answered Jan 22 '26 18:01

un_vato_ordinario



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!