score:0
are you using react router? having more info on your routing code and lib, or a link to your code would greatly help.
if you are indeed using react router, i believe the basename
property would help.
<browserrouter basename="react-app-name">
<routes>
<route path="/" element={<app />}>
<route path="users" element={<users />} />
</route>
</routes>
</browserrouter>
score:0
if i understand your question correctly, you might have missed setting the homepage
property properly in your package.json
file.
here is how to do so:
- open your
package.json
file. - at the top level, give the homepage of your app in this format:
https://<gitname>.github.io/<repo-name>
.
here is an example:
{
"name": "react-app",
"version": "0.1.0",
"homepage": "https://gitname.github.io/react-app-name",
....
your react app will be deployed at /react-app-name
.
to learn more about how to deploy a react app to github pages, read this.
if that was indeed done correctly, you might want to look into specifying the basename
prop in browserrouter
that provides a base url path for all the locations in the application (as suggested in ivanosevitch's answer).
if none of the above solves the issue, please elaborate on your problem so it is easier to understand where it is stemming from.
Source: stackoverflow.com
Related Query
- ReactJS app deployed on GitHub pages does not work with custom domain set
- GitHub gh-pages to work with the app domain name?
- ReactJS app published to Github pages with custom domain
- Faced Failed to load resource: the server responded with a status of 404 () when uploaded my react app to github pages
- State in redux/react app has a property with the name of the reducer
- How can I develop locally using a domain name instead of 'localhost:3000' in the url with create-react-app?
- 404 Error on refresh with SPA React Router app in GitHub Pages
- Deploying react app on github pages front and backend in the same repository
- How to change the domain name on a local deployed React app
- How to get the current domain name a react app is running on
- Disable the bundle.js bundling file Webpack creates in React using Create React App or Craco? Or at least get 'Performance' to work with source maps
- What's the proper way to work with 'react-leaflet' library in a react app made with 'create-react-app'?
- Deploying React app with Parcel build on Github Pages
- `window.location.href` does not work on react app when deploying on github pages
- How to integrate a Nodejs API with ReactJs app under the same domain
- React app only displays the background color when deployed to github pages
- Problem with relative path when deploying react app to a subfolder in GitHub pages
- Issue with publishing React app to Github pages
- Home Component is not rendering when the app loads on Github Pages but loading on Localhost
- Conditionally use next.js app or create react app with the same website domain according to users login
- React App just shows the starting page on Github pages
- How can I get the activeClass to work with static pages after a Next.js export?
- React's props with the same name as their value
- How to detect the device on React SSR App with Next.js?
- Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider error with @react-navigation/stack
- How to make Puppeteer work with a ReactJS application on the client-side
- How should the new context api work with React Native navigator?
- Find component by display name when the component is stateless functional, with Enzyme
- How change the sender name of a mail with nodemailer?
- Trying to deploy my React app with gh-pages but got this error message : The "file" argument must be of type string. Received type undefined
More Query from same tag
- Action mapped with mapDispatchToProps does not take parameter
- How to pass comp A variable to prop.children which in turn are the result of an array.map within the comp A
- useState value resets after navigating through NavLinks
- State hooks does not update state parameters on redux store update
- "foo" is not a function using Jest to test a component method
- straight out of react.js.org and it crashes
- Can I pass simple arrays in redux state?
- React Redux best practices for performing actions
- what should a React checkbox alike component expose as API?
- How can I make audio play for duration of a countdown timer in React?
- How to render list of list in react?
- How do I properly call multiple functions in componentDidMount?
- react-virtualized: SetState in AutoSizer
- Same value is updating in all the elements in the array in React
- One of my component in React is not loading while the rest of the components load fine
- React state resets when set from prop event handler
- how to filter with two condition in react.js
- Error in building app with react-hook-form using TS
- Four buttons use One Function?
- Render react component from a different file
- useEffect does not see the state update
- i met problem with my shopping card in reactjs?
- AntDesign select menu, want to only show part of the option when selected
- Navigate to anther component while on-form submit and passing the data to navigating component react Js
- Cancel requests on route change (React/Redux/Axios)
- How do I use useRef on a component that I don't have access to in React BigCalendar
- Why state is not declared when it was set properly?
- React: How can I call a method only once in the lifecycle of a component, as soon as data.loading is false
- Cast to ObjectId failed for value "undefined" (type string) at path "_id" for model "Car"
- React-Native - i18n separate files