React Native: Failed prop type for 'container'
See original GitHub issueFirst off, thanks for providing this great module! I’m working on integrating this into a React Native app, using a custom built preset that creates appropriate React Native components for my project. So far, so good. I’ve wrapped the react component in @bbob/react
in a functional component as below, but I’m just running into one warning with PropTypes. In React Native, all text must be inside a Text
component, so I need to override the default container
with (my custom) Text
component.
<BBCodeCore
container={Text}
componentProps={rest}
plugins={[myPreset()]}
options={{
onlyAllowTags: [
'b',
'code',
'i',
'img',
'list',
'*',
'quote',
'url',
],
}}
>
{children}
</BBCodeCore>
This all works fine functionally, but in development I’m getting the below warning from prop-types
:
Warning: Failed prop type: Invalid prop 'container' supplied to 'Component', expected a ReactNode.
I believe I’m setting this property as intended, but if there’s a different way to do it to avoid the warning, let me know. Otherwise, is it possible to augment the prop-type for this property to also support this scenario?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@dpolivy Sorry for long release publish 😃 Now you can use 2.7.1 version with your fixes.
Sure.