How to deploy reactjs project on netlify?

I am trying to deploy reactjs project on it but it is not working. I tried manual and importing from git. Both of methods are not working. Could please tell me how to do that properly ?

Hey @Kalim22

You can find documentation on common/recommended configuration for React here (Netlify) and here (CRA).

If this doesn’t provide a solution, can you share the repository you are wanting to deploy.

I tried all things but my site preview is blank. Maybe I am not doing it right.
Can you please explain me step by step.

I believe you have a homepage attribute set in the package.json of the project. Remove this attribute.

Yes, I have. I used it for deploying in github. If i remove it now after pushing on github, would it affect on github ?

As mentioned in the CRA Deployment documentation under GitHub Pages without this value, the deployed site won’t work.

When deploying to Netlify, the site is deployed at the root of the domain. The value that works for GitHub breaks deploys on Netlify as the React build looks to a sub-path for files as seen in the document

Note the /Kalim22/tip-calculator-frontendChallenge/ in the src and href values.

There is a workaround @Kalim22 that will enable you to keep the homepage attribute.

Change the build command used on Netlify to

PUBLIC_URL='/' npm run build