This project is built to help understand how to code split child components to optimize performance in React Web apps with create-react-app
-
App Component In this page there is a button and a modal. On Click of the button the modal should be shown. The logic is to not to render the modal.js until the button is clicked
-
Modal Component Displays the modal component
To get you started you can simply clone the repository:
git clone https://github.com/Rajdeepc/react-code-split-component.git
You need git to clone the repository. You can get git from http://git-scm.com/.
A number of node.js tools is necessary to initialize and test the project. You must have node.js and its package manager (npm) installed. You can get them from http://nodejs.org/.
and install the dependencies
npm install
npm run lint
npm run buildTo Run Locally Steps to follow:
npm start
git checkout masterfrom any folder in your localhttps://github.com/Rajdeepc/react-code-split-component.gitrepositorygit pull origin masterto ensure you have the latest main codegit checkout -b the-name-of-my-branch(replacingthe-name-of-my-branchwith a suitable name) to create a branch
- Follow the "Running locally" instructions
- Save the files and check in the browser
- Changes to React components in
srcwill hot-reload - Changes to markdown files in
contentwill hot-reload - If working with plugins, you may need to remove the
.cachedirectory and restart the server
git add -A && git commit -m "My message"(replacingMy messagewith a commit message, such asFixed header logo) to stage and commit your changesgit push my-fork-name the-name-of-my-branch- Go to the react-code-split-component and you should see recently pushed branches.
- Follow GitHub's instructions.
- If possible, include screenshots of visual changes. A Netlify build will also be automatically created once you make your PR so other people can see your change.

