This is a bug in React.createElement code:
React.createElement does not warn if props.__proto__ is null ( from Object.create(null) ) since it believes that to be a plain object originating from #6134. But since it directly accesses hasOwnProperty it fails if such object is passed as props.
Reproduce:
const props = Object.create(null);
React.createElement(() => null, props);
What is the expected behavior?
It shouldn't use hasOwnProperty directly on props if such object is expected.
React: 15.1.0
Browsers: All
OS: All
This affects all versions of React but since after 15.1.0 the acceptable shape of props is explicitly defined then it should be explicitly supported as well.
This is a bug in
React.createElementcode:React.createElementdoes not warn ifprops.__proto__is null ( fromObject.create(null)) since it believes that to be a plain object originating from #6134. But since it directly accesseshasOwnPropertyit fails if such object is passed as props.Reproduce:
What is the expected behavior?
It shouldn't use
hasOwnPropertydirectly on props if such object is expected.React: 15.1.0
Browsers: All
OS: All
This affects all versions of React but since after 15.1.0 the acceptable shape of props is explicitly defined then it should be explicitly supported as well.