prop type checking fails when using mobx
See original GitHub issueWhen using mobx for state management the proptype checking fails:
Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `BootstrapTable`, expected `array`.
The reason is that the provided property is not a simple array anymore but an ObservableArray:
@observable
data = [...];
Any ideas how to solve this without loosing observability of the property?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Is there a way to check propTypes for observer(Component)
If you want to check if the Comp prop is a type that can be rendered, you can use PropTypes.elementType starting with prop-types...
Read more >Runtime Type Checking - mobx-keystone
This allows you to associate arbitrary metadata with the type of a prop that you can then use at runtime against instances. const...
Read more >How to use the mobx-react.PropTypes ... - Snyk
To help you get started, we've selected a few mobx-react.PropTypes.arrayOrObservableArray examples, based on popular ways it is used in public projects.
Read more >mobx-react - npm
The above propTypes are incorrect, bold needs to be provided by the caller of the UserName component and is checked by React. However,...
Read more >mobxjs/mobx - Gitter
Hello, Im trying my first steps with mobx & typescript. I checking around ... Property 'store' is missing in type '{ message: string;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works like a charm. Solved it by slicing the array before using it:
👍