Comments (9)
and if you don’t include the shim, you’re saying it doesn’t crash? (note that you should also be using the es6-shim as wel
Sorry, made the wrong assumption, still errors when not including the shim. The problem lies in Storybook. This thread can be closed.
from es5-shim.
I'm not sure what you mean. PropTypes.shape
only works with an object, not with undefined or null, and Object.keys
always throws with null
or undefined
. PropTypes.shape()
is incorrect.
from es5-shim.
@ljharb React doesn't require it: See jsx-eslint/eslint-plugin-react#1471
from es5-shim.
@1Jesper1 if they're passing the argument value into Object.keys()
then they do require it, since that always throws on null or undefined.
That linked issue is about the linter crashing on it, which is unrelated.
Can you provide the full stack trace, and the code for your shape
creation?
from es5-shim.
Using:
static propTypes = {
style: PropTypes.shape(),
}
crashes on return originalKeys(object);
from es5-shim.
and if you don’t include the shim, you’re saying it doesn’t crash? (note that you should also be using the es6-shim as well)
from es5-shim.
It doesn't crash when I don' include require("airbnb-js-shims");
https://github.com/airbnb/js-shims
from es5-shim.
That's very bizarre. Can you provide the entire stack trace?
from es5-shim.
TypeError: Cannot convert undefined or null to object
at keys (<anonymous>)
at Function.keys (http://localhost:9001/static/iframe.bundle.js:42468:24)
at Shape.render (http://localhost:9001/static/iframe.bundle.js:18793:39)
at finishClassComponent (http://localhost:9001/static/iframe.bundle.js:155929:31)
at updateClassComponent (http://localhost:9001/static/iframe.bundle.js:155884:24)
at beginWork (http://localhost:9001/static/iframe.bundle.js:156832:16)
at performUnitOfWork (http://localhost:9001/static/iframe.bundle.js:160500:12)
at workLoop (http://localhost:9001/static/iframe.bundle.js:160540:24)
at renderRoot (http://localhost:9001/static/iframe.bundle.js:160623:7)
at performWorkOnRoot (http://localhost:9001/static/iframe.bundle.js:161530:7)
I think the problem is in Storybook Shape.js class: Object.keys(propTypes).map(function
from es5-shim.
Related Issues (20)
- All V8 versions have the Date shim loaded. HOT 1
- Rounding errors with toExponential in Edge 15/16 HOT 4
- IE9 error: Redeclaration of const property HOT 5
- Something in the shim causes Chrome to throw a warning HOT 3
- 4.5.11 got a tag, but not a full release HOT 2
- `hasAutomationEqualityBug` triggers deprecation warnings in Firefox
- Question: Why concatenate Symbols with a string without assigning it to a variable? HOT 6
- Why not set bound.prototype = target.prototype directly? HOT 3
- in ie8 Object.keys failed this conversion HOT 3
- Action required: Greenkeeper could not be activated 🚨
- String#lastIndexOf has a shallow-wrapper shim that does nothing and always gets applied HOT 1
- Dependency Dashboard
- Conflict ES5-shim(sham) 4.5.15 and ES6-shim(sham) 0.35.x HOT 19
- Please change the name of the default branch HOT 1
- External URL linking to spam websites HOT 2
- errors with Object.defineProperty under ie8 since 4.6.3 HOT 6
- Incompatibility with awilix HOT 17
- Invalid Date on Safari HOT 2
- ⚠️ `webkitStorageInfo` is going away HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from es5-shim.