Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Nisarg155 committed Oct 18, 2023
1 parent 2ebdc26 commit 14e01b9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion components/react/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@

# Important!------------------------------------------------------

# Use "npm start" in react-components directory to start the react project.
## To create a new component follow these steps:
- Go to package.JSON file and replace the _**homepage url**_ `https://csiddu.github.io/Frontend-Treasure/components/react/build/` with `http://127.0.0.1:5500/components/react/build/` i.e your live server url followed by `components/react/build/`. This is necessary as Production Url has to be replaced with Live Server's IP.
- Make an entry in **App.js > path** object eg: `<component-name>: <Component/>`
- Make an entry for url in components.JSON. eg: `react/build/?<component-name>`
- Make an entry for url in Layout.jsx. For local development use: `/components/react/build/?<component-name>` and before committing make it to `/Frontend-Treasure/components/react/build/?<component-name>`. This is because repo name should be included for github pages deployment.
- Finally add your component card in components.html.
- #### Note: During development, if your code doesn't work, make sure to build react app. If still any issue persists, read the steps again.
- ### Before committing:

1. Always explicitly, **build the react project, every-time before committing** `npm run build`. Only then your changes will be reflected in static build.
2. Make sure the Urls in package.json and Layout.jsx are production friendly, as mentioned earlier. (Refer code for more understanding).

## Use "npm start" in react-components directory to start the react project.
## This React Project contains all the react based components. This project can be viewed [http://localhost:3000](http://localhost:3000) followed by the SLUG (Endpoint) of the components.
## Multiple other components can be created in the pages directory of this project. The "Layout" page holds the list of components made in react.
## Error page holds error message for invalid request.
Expand Down

0 comments on commit 14e01b9

Please sign in to comment.