N
N
Nikita Shchypylov2018-05-08 18:41:02
React
Nikita Shchypylov, 2018-05-08 18:41:02

Routing options for a server-less React app other than react-router and Next.js?

Hello everyone
What else is there for routing? React-router is like walking through a minefield and problems with deployment are constant (without a server, I repeat). For Next, you need to rewrite everything.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yspb, 2018-05-09
@yspb

I am using npm history library without any react route.
What it does is align the api for navigation across different browsers.
For example, you can get the current value in the address bar like this:

import createHistory from 'history/createBrowserHistory'
let history = createHistory()
let { pathname } = history.location

And then you can pass this pathname as props to components, store it in the store, do push, etc.
Read the article jamesknelson.com/even-need-routing-library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question