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

Error in build for typescript #29

Open
iOS321 opened this issue Mar 3, 2023 · 2 comments
Open

Error in build for typescript #29

iOS321 opened this issue Mar 3, 2023 · 2 comments
Labels
question Further information is requested

Comments

@iOS321
Copy link

iOS321 commented Mar 3, 2023

recoil - 0.7.6
recoil-nexus - 0.4.0
react-router-dom - 6.8.2

When i am adding RecoilNexus in RecoilRoot i am getting error 'This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.' for RecoilRoot

<RecoilRoot>
    <RecoilNexus />
     <Router>
         <Routes>
            <Route path='/login' element={<Layout pageTitle={'Login'}/>}>
              <Route index element={<Login/>}/>
            </Route>
            <Route path='/sign-up' element={<Layout pageTitle={'Welcome'}/>}>
              <Route index  element={<SignUp />}/>
            </Route>
            <Route path='/forgot-password' element={<Layout pageTitle={'Forgot Password'}/>}>
              <Route index  element={<ForgotPassword />}/>
            </Route>
            <Route path='/' element={<Layout pageTitle={'Home'} stateType={null} path='/'/>}>
              <Route index  element={<Home />}/>
            </Route> 
            <Route path='*' element={<PageNotFound />} />
          </Routes>
    </Router>
</RecoilRoot>

I have a typescript project, please suggest how to resolve this.

@luisanton-io
Copy link
Owner

I took some time to reproduce this but I can't see the error you're facing.
Can you help to reproduce the error? Feel free to mess around with the sandbox:

https://codesandbox.io/s/confident-bartik-w6y08y?file=/src/App.js

@luisanton-io luisanton-io added the question Further information is requested label Mar 7, 2023
@iOS321
Copy link
Author

iOS321 commented Mar 16, 2023

This error comes when I use typescript, the sandbox is using js files, please check with typescript instead.

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

No branches or pull requests

2 participants