obviously working too late. somehow overwrote my own previous commit…

- adding back in the IE bug fix polyfill for `startsWith`
- also updating the README to reflect latest supported react version
This commit is contained in:
Jason Salzman
2017-05-22 04:53:49 -07:00
parent 8dfc9b57b5
commit 7e8b51bb19
4 changed files with 11 additions and 12 deletions
-9
View File
@@ -1,9 +0,0 @@
node_modules
.sass-cache
npm-debug.log
.idea
dist
lib
tmp
coverage
0.md
+1 -1
View File
@@ -70,7 +70,7 @@ See [here](https://github.com/jasonsalzman/react-add-to-calendar/blob/master/doc
I'll do my best to stay compatible with the latest version of React. I can't guarantee support for all older versions of React. I'll do my best to stay compatible with the latest version of React. I can't guarantee support for all older versions of React.
Latest compatible versions: Latest compatible versions:
- React 15.0.0 or newer - React 15.5.0 or newer
### Browser Support ### Browser Support
+1 -1
View File
@@ -2,7 +2,7 @@
"author": "Jason Salzman", "author": "Jason Salzman",
"name": "react-add-to-calendar", "name": "react-add-to-calendar",
"description": "A simple and reusable add to calendar button component for React", "description": "A simple and reusable add to calendar button component for React",
"version": "0.1.0", "version": "0.1.1",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/jasonsalzman/react-add-to-calendar", "homepage": "https://github.com/jasonsalzman/react-add-to-calendar",
"repository": { "repository": {
+8
View File
@@ -18,6 +18,14 @@ export default class ReactAddToCalendar extends React.Component {
} }
componentWillMount() { componentWillMount() {
// polyfill for startsWith to fix IE bug
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
let isCrappyIE = false; let isCrappyIE = false;
if ( if (
typeof window !== "undefined" && typeof window !== "undefined" &&