Specifying a basename when app isn't hosted at site root
See original GitHub issueI’m trying to use redux-first-router in a create-react-app app that specifies a homepage
in package.json
since the app won’t be hosted at the root of the site. From what I can tell, it looks like I’ll have to include that route prefix for each entry in my routesMap
. I’ve been looking through the RFR source to see if there’s a way to pass a basename
(or similar) option that would allow the pathname
to be enhanced if that option exists but it doesn’t look like it’s possible at the moment.
Is there currently a way to use RFR when an app isn’t going to run at the root of a site? If not, is it reasonable to request the ability to specify a basename
- perhaps in the options passed to connectRoutes
?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:14 (14 by maintainers)
Top Results From Across the Web
How should I configure create-react-app to serve app from ...
By default, Create React App produces a build assuming your app is hosted at the server root. To override this, specify the homepage...
Read more >Runtime environment variables - facebook/create-react-app
I've been struggling with this problem in few projects and IMHO it's crucial to be able to specify environment variables for configuring the ......
Read more >Deploying Your CRA React App on Github Pages
1. Check out the Github Pages settings. Open up your Github repo and navigate to Settings > Pages. This is going to be...
Read more >Configuration | UmiJS
Specify the base of the react-router to be configured when deploying to a non-root directory. # publicPath. Type: String; Default: /. Specifies the...
Read more >Shared Options
Project root directory (where index.html is located). Can be an absolute path, or a path relative to the current working directory. See Project...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
basenames are supported now:
https://github.com/faceyspacey/redux-first-router/issues/103#issuecomment-329972201
We don’t. That’s not what Im saying. I’m saying there’s likely more that also needs to be done and we should find it, or this would be closed.
Just take it over brotha and take it all the way.