Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd additional fallbacks when self is undefined #521
Conversation
|
I have no experience with React Native, but their documentation suggests that |
|
@mislav The polyfill itself may not be needed, but libraries that support multiple platforms (including react itself) can't know that, and without self the polyfill crashes at the point where you check if it is needed. |
|
@mislav incidentally, I don't think that documentation implies fetch is available natively - just that react wraps this polyfill so the app developer doesnt have to think about it. |
|
Related to this conversation:
which means the final line of the script is compiled into: This is using the ES6 |
|
Any idea when is this gonna be merged? We're trying to use |
|
We now generate a UMD build with Rollup: #616. Let us know if this build works with React Native. The main |
This extends the solution in #253 for React Native compatibility.
The existing
thisfallback is inadequate because in strict modethisis undefined outside of class methods rather than defaulting to the global object.