ReactTraining / react-history

Manage session history with React
266 stars 23 forks source link

Upgrading to react 16 #23

Closed romellogoodman closed 6 years ago

romellogoodman commented 6 years ago

Hello! I was wondering if there was a timeline for upgrading this component to react 16?

I tried doing it myself but ran into an issue where I couldnt get all of the tests passing. Its the same issue that is causing the build to currently fail. The file modules > __tests__ > RenderTestSequences > ReplaceChangesTheKey.js is causing the tests to fail. This is the output of the CI build that is failing:

Error: Expected { pathname: '/', search: '', hash: '', state: undefined, key: '0hx5id' } to match { pathname: '/', key: undefined }
       at assert (webpack:///~/expect/lib/assert.js:29:0 <- tests.webpack.js:25858:4)
       at toMatch (webpack:///~/expect/lib/Expectation.js:138:0 <- tests.webpack.js:23296:9)
       at Anonymous function (webpack:///modules/__tests__/RenderTestSequences/ReplaceChangesTheKey.js:11:6 <- tests.webpack.js:28189:7)
       at Anonymous function (webpack:///modules/__tests__/RenderTestSequences/createRenderProp.js:12:6 <- tests.webpack.js:27467:8)
       at render (webpack:///modules/MemoryHistory.js:52:4 <- tests.webpack.js:29130:6)
       at Anonymous function (webpack:///~/react-dom/lib/ReactCompositeComponent.js:793:0 <- tests.webpack.js:16402:10)
       at measureLifeCyclePerf (webpack:///~/react-dom/lib/ReactCompositeComponent.js:73:0 <- tests.webpack.js:15682:6)
       at _renderValidatedComponentWithoutOwnerOrContext (webpack:///~/react-dom/lib/ReactCompositeComponent.js:792:0 <- tests.webpack.js:16401:8)
       at _renderValidatedComponent (webpack:///~/react-dom/lib/ReactCompositeComponent.js:819:0 <- tests.webpack.js:16428:10)
       at performInitialMount (webpack:///~/react-dom/lib/ReactCompositeComponent.js:359:0 <- tests.webpack.js:15968:8)

The problem is that the location object provided to the first step does not match the expected location object. If this is solved I think upgrading to react should be pretty easy to do. Also if youre too busy to take a look at this, then I can continue to dig around history to figure out why this initial location object changed if you point me in the right direction.

Thanks!

romellogoodman commented 6 years ago

Closing issue because I am opening a PR to fix the test and do the upgrade