Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

IE 11 Compatibility #32

Closed
AndreBastos23 opened this issue Jan 10, 2018 · 3 comments
Closed

IE 11 Compatibility #32

AndreBastos23 opened this issue Jan 10, 2018 · 3 comments
Labels

Comments

@AndreBastos23
Copy link

Hello,

Your library does not work with IE11.
I traced the problem to the "includes" method that you use when verifying the placeholder props. IE11 does not recognize that method. Is it possible to swap to a polyfill alternative?

@Aidurber Aidurber added the bug label Jan 10, 2018
@Aidurber
Copy link
Owner

Yes that's possible. Good find, I thought my babel config took care of that, apparently not. Thanks for reporting.

@AndreBastos23
Copy link
Author

If you dont want to change that much code, you can paste the following code on your entry react component. That's what i did to fix this.

if (!String.prototype.includes) { String.prototype.includes = function (search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > this.length) { return false; } else { return this.indexOf(search, start) !== -1; } }; }

That basically creates the prototype "includes" if it doesnt exist..

@Aidurber
Copy link
Owner

@AndreBastos23 decided to use lodash.includes, that fixes the Array.prototype.includes issue in IE11 too.

Sorry about that, fixed in 1.7.1 which is on npm now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants