why this error when using Nativebase components without 'use client'
Unanswered
Jack Riddles posted this in #help-forum
Is there a way to resolve this issue which forces me to use the 'use client' in files with components using nativebase tags .
https://github.com/bijomathewjose/NextJs-App-Router-with-NativeBase
https://github.com/bijomathewjose/NextJs-App-Router-with-NativeBase
3 Replies
Sun bear
You are using the component like this:
And this is the component:
The component is not really a component you can use like it. I would expect the component to receive the children and return it like
<Text>some</Text>And this is the component:
export const Text = {
baseStyle: ({ colorMode }) => {
return {
color: colorMode === 'dark' ? 'red.800' : 'blue.900',
fontWeight: 800,
fontFamily: 'Kalnia Glaze',
};
},
}The component is not really a component you can use like it. I would expect the component to receive the children and return it like
export default function Text({children}:{children: ReactNode}) {
return (
<div>{children}</div>
)
}@Sun bear You are using the component like this:
<Text>some</Text>
And this is the component:
export const Text = {
baseStyle: ({ colorMode }) => {
return {
color: colorMode === 'dark' ? 'red.800' : 'blue.900',
fontWeight: 800,
fontFamily: 'Kalnia Glaze',
};
},
}
The component is not really a component you can use like it. I would expect the component to receive the children and return it like
export default function Text({children}:{children: ReactNode}) {
return (
<div>{children}</div>
)
}
this is a nativebase configuration
https://docs.nativebase.io/customizing-components
https://docs.nativebase.io/customizing-components
even if I dont use this ,the same issue will happen custom component configuration this error happens