bug(Popup): invalid usage of oneOfType in propTypes
See original GitHub issue// index.js
import React from 'react';
import { render } from 'react-dom';
import App from './containers/App';
import '../node_modules/semantic-ui-css/semantic.min.css';
render(
<App />,
document.getElementById('root')
);
// App.js
import React, { Component } from 'react';
import { Header } from 'semantic-ui-react';
class App extends Component {
render() {
return (
<div>
<Header>lalalalal</Header>
</div>
);
}
}
export default App;
// warning in browser console
Warning: Invalid argument supplied to oneOfType, expected an instance of array.
As you can see it’s quite a simple example, in fact I’ve tried with multiple semantic-ui-react
components, Header
Icon
… all of them show the same warning. Which comes as soon as you import them in a file.
// using create react app
"devDependencies": {
"react-scripts": "0.9.0",
"semantic-ui-css": "^2.2.4",
"semantic-ui-react": "^0.65.0",
},
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2"
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Warning for: PropTypes.object.isRequired when prop is `null ...
It expects a function: Warning: Invalid argument supplied to oneOfType. Expected an array of check functions, but received null at index 1. So, ......
Read more >How do I include window as a valid prop with PropTypes?
What you can do is use oneOfType and include an instance of the window object's constructor, Window : PropTypes.
Read more >Typechecking With PropTypes - React
PropTypes exports a range of validators that can be used to make sure the data you receive is valid. In this example, we're...
Read more >Master React PropTypes w/ Comprehensive Guide - Copycat
In this extensive guide, you'll learn what React PropTypes is, how to integrate PropTypes with React, and how to use PropTypes effectively.
Read more >Invalid prop children warning with Button - Telerik Forums
I will check if there is a specific reason why another component is not a valid prop and we will update the PropTypes...
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
something happened in this version
v0.65.0 (2017-02-17)
to cause the bug. Switching to the older release0.64.8
solves it for now…PR is up and will be released soon. Note for the future if you’re considering a rollback, propType warnings (while annoying) are not errors and are therefore harmless to your app.