question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
harmon25commented, Feb 19, 2017

something happened in this version v0.65.0 (2017-02-17) to cause the bug. Switching to the older release 0.64.8 solves it for now…

0reactions
levithomasoncommented, Feb 21, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found