BEST
Applying TypeScript to React while learning while making web games
Let's use React and TypeScript together by adding TypeScript to a web game made with React and React Router, Redux, and MobX.
React
React
TypeScript
TypeScript
Add react-router@6 code
https://github.com/ZeroCho/ts-react/tree/master/react-router
I updated the code because a student asked for the react-router 6 code.
It's a lot different from react-router@5. It's integrated with reach-router and seems to have changed a lot to be used in a react-based framework called remix.
Switch, render, exact, children, component, useHistory, useRouteMatch, etc. are all gone.
Replaced by Routes, element, useNavigate, etc.
One notable difference is that it no longer supports class syntax. You have to use it in a class with a bit of a hack (I don't know if anyone still uses class though...)
Comment




