Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes

$
0
0

ThemeProvider from react-native-elements in not allowing childrens.

Here is the code :

const Root = () => {  const {theme, isNewUser} = Settings.useContainer();  const darkMode = useMemo(() => theme === 'dark', [theme]);  return (<ThemeProvider theme={darkMode ? darkTheme : lightTheme} useDark={darkMode}>      {isNewUser ? <OnboardingStack /> : <BottomTab />}</ThemeProvider>  );};

ThemeProvider is having red underline, on hover it is saying

Type '{ children: Element; theme: RCTheme; useDark: boolean; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<ThemeProvider> & Pick<Readonly<ThemeProviderProps>, never> & InexactPartial<...> & InexactPartial<...>'.  Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<ThemeProvider> & Pick<Readonly<ThemeProviderProps>, never> & InexactPartial<...> & InexactPartial<...>'.ts(2322)

enter image description here


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>