App.tsx - Section needs type for "children"
ameetmadan opened this issue · 5 comments
Expected results
What did you expect to happen?
App.tsx has no TypeScript errors
const Section: React.FC<{
title: string;
children: React.ReactNode; /* This line needs to be added to correct the errors */
}> = ({children, title}) => { ... }
Observed results
What happened?
App.tsx has TypeScript errors
const Section: React.FC<{
title: string;
}> = ({children, title}) => { ... }
You've likely bumped @types/react to v18 (similar recent type error)
Sticking to
react-native-template-typescript/template/package.json
Lines 32 to 34 in 666bc91
should fix it, which keeps our PropsWithChildren
type, meant for RN 0.68 and below
But yes RN 0.69.0-rc.0 bumps React to v18, when we'll want to bump @types/react
to v18 with your change above
if you fancy giving it a shot (like here) - looking into it too, working well generally
Be sure you have yarn
installed so that npx react-native init
doesn't use npm
to install the dependencies since "resolutions"
is a yarn
-specific field.
btw this should be resolved since #277
thanks again for raising and the suggestion ^
Yes, this is resolved now.