Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Commit

Permalink
fix: change build target to ES5 / IE11. Fixes #835
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Feb 13, 2020
1 parent 9b2ffb1 commit 09bdba8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]],
"presets": [["@babel/preset-env", { "targets": { "ie": "11" } }]],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true}],
["@babel/plugin-proposal-class-properties", { "loose": true}],
"@babel/plugin-transform-react-jsx"
]
}
}
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@
],
"testURL": "http://127.0.0.1/"
}
}
}
3 changes: 2 additions & 1 deletion src/observer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export function observer<T extends IReactComponent>(component: T): T {
if (typeof baseRender !== "function")
throw new Error("render property of ForwardRef was not a function")
return React.forwardRef(function ObserverForwardRef() {
return <Observer>{() => baseRender.apply(undefined, arguments)}</Observer>
const args = arguments;
return <Observer>{() => baseRender.apply(undefined, args)}</Observer>
}) as T
}

Expand Down
3 changes: 2 additions & 1 deletion test/inject.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ describe("inject based context", () => {
let injectRender = 0

function connect(): IReactComponent {
const args = arguments;
return (component: IReactComponent) =>
// @ts-ignore
inject.apply(this, arguments)(observer(component))
inject.apply(this, args)(observer(component))
}

class State {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"sourceMap": false,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es6"
"target": "es5"
},
"include": ["src/**/*.ts", "test/**/*.ts"]
}

0 comments on commit 09bdba8

Please sign in to comment.