-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Typescript error: Property 'children' does not exist on type 'IntrinsicAttributes & Props' (TailwindProvider) #169
Comments
i'm also getting same error for the TailwindProvider |
Me too |
Same |
Any update on this? |
You can edit your TailwindProvider interface definition props in node_modules/tailwind-rn/dist/tailwind-provider.d.ts like: interface Props { Can i do a pull request with this, but i need confirmation of some collaborator for the scope of the change |
Hey, any idea how can we can override this error without modifying node_modules? |
The unique solution is add the fix to master branch. The node_modules is genertaed by that. |
Temporary workaround is to use patch-package module
Edit package.json and add this in scripts
Edit TailwindProvider interface definition props in node_modules/tailwind-rn/dist/tailwind-provider.d.ts (Credit to frannale)
Run
Done! the package will be auto patched whenever you reinstall the dependencies |
If anyone else is experiencing this, feel free to use my fork |
I need to update |
I still have the same error with React 18. "dependencies": {
"expo": "~46.0.8",
"expo-status-bar": "~1.4.0",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.4",
"react-native-web": "~0.18.7",
"tailwind-rn": "^4.2.0",
"@expo/webpack-config": "^0.17.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~18.0.14",
"@types/react-native": "~0.69.1",
"concurrently": "^7.3.0",
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8",
"typescript": "~4.3.5"
}, |
What's going on here? |
I'm not sure |
See #158 |
Without a patch, but overriding type definition // app-env.d.ts declare module 'tailwind-rn' {
export * from 'tailwind-rn';
interface Props {
utilities: Utilities;
colorScheme?: ColorSchemeName;
children?: React.ReactNode | React.ReactNode[]
}
export const TailwindProvider: React.FC<Props>;
} // tsconfig.json "include": ["app-env.d.ts", ...], |
It helped me, but now I have a new error when importing useTilewind, do you know how to fix it?
|
@groom7 typing the hook in a generic mode will help you at least get rid of the type issue until this gets fixed:
Although I keep getting error with the classes, Im just gonna try an old version of the package |
I'm getting this error on a typescript project I'm currently working on but also occurs when initing a new typescript project.
I think this could be fixed by adding
children?: React.ReactNode | React.ReactNode[]
to the interface Props but I'm not entirely sure.The text was updated successfully, but these errors were encountered: