Skip to content

Commit

Permalink
Update React & Typings
Browse files Browse the repository at this point in the history
Now we don't have to use our own type defs for hooks, yay!
  • Loading branch information
ianobermiller committed Dec 7, 2018
1 parent 0120236 commit 2675faf
Show file tree
Hide file tree
Showing 9 changed files with 2,858 additions and 489 deletions.
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"private": true,
"dependencies": {
"emotion": "^9.2.12",
"react": "^16.7.0-alpha.0",
"react-dom": "^16.7.0-alpha.0",
"react": "^16.7.0-alpha.2",
"react-dom": "^16.7.0-alpha.2",
"react-scripts-ts": "3.1.0",
"redux": "^4.0.1"
},
Expand All @@ -18,7 +18,7 @@
"eject": "react-scripts-ts eject"
},
"devDependencies": {
"@types/react": "^16.3.13",
"@types/react": "^16.7.13",
"@types/react-dom": "^16.0.5",
"typescript": "^3.1.3"
}
Expand Down
17 changes: 0 additions & 17 deletions example/src/typings.d.ts

This file was deleted.

1,624 changes: 1,415 additions & 209 deletions example/yarn.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
},
"peerDependencies": {
"prop-types": "^15.5.4",
"react": "^16.7.0-alpha.0",
"react-dom": "^16.7.0-alpha.0",
"react": "^16.7.0-alpha.2",
"react-dom": "^16.7.0-alpha.2",
"redux": "^4.0.1"
},
"devDependencies": {
"@types/jest": "^23.1.5",
"@types/react": "^16.3.13",
"@types/react": "^16.7.13",
"@types/react-dom": "^16.0.5",
"babel-core": "^6.26.3",
"babel-runtime": "^6.26.0",
"cross-env": "^5.1.4",
"gh-pages": "^2.0.1",
"prettier": "^1.14.3",
"react": "^16.7.0-alpha.0",
"react-dom": "^16.7.0-alpha.0",
"react": "^16.7.0-alpha.2",
"react-dom": "^16.7.0-alpha.2",
"react-scripts-ts": "^3.1.0",
"redux": "^4.0.1",
"rollup": "^0.66.6",
Expand Down
1 change: 0 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default {
}),
commonjs(),
copy([
{files: ['src/typings.d.ts'], dest: 'dist/src'},
// The example uses create-react-app (via create-react-library), which
// doesn't work correctly with yarn or npm links. It will end up with
// two versions of React in the build, which breaks hooks in particular
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/index-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ interface IState {
// https://github.com/kentcdodds/react-testing-library/issues/215
// useEffect is not triggered on re-renders
beforeAll(() =>
jest.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect));
jest.spyOn(React, 'useEffect').mockImplementation(React.useLayoutEffect),
);
afterAll(() => (React.useEffect as any).mockRestore());

describe('redux-react-hook', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function useMappedState<TState, TResult>(
// in the array of memoization paramaters to the second useEffect below,
// which would cause it to unsubscribe and resubscribe from Redux everytime
// the state changes.
const lastRenderedDerivedState = useRef();
const lastRenderedDerivedState = useRef(derivedState);
// Set the last mapped state after rendering.
useEffect(() => {
lastRenderedDerivedState.current = derivedState;
Expand Down
21 changes: 0 additions & 21 deletions src/typings.d.ts

This file was deleted.

Loading

0 comments on commit 2675faf

Please sign in to comment.