This React template is based on create-react-app and has its README.md
which you can find very useful.
{% hint style="warning" %}
You don’t need to install or configure tools like Webpack or Babel.
They are configured and hidden so that you can focus on the code.
{% endhint %}
Before proceeding you’ll need to have the latest stable NodeJS and npm installed on your machine.
-
Open your favorite console application (Terminal, iTerm, Command Prompt, etc.). Navigate to the
materially/
folder and Install packages :npm i,
npm install
oryarn install
. This command will install all the required Node.js modules into the directorynode_modules
insidematerially/
folder. And now, you are ready to run the able pro material for the first time. -
To run the project locally:
npm start
oryarn start
This command will runs the app in development mode. Open http://localhost:3000 to view it in the browser.The page will automatically reload if you make changes to the code.
-
Now you can use This React hooks material project for your application development, make the necessary changes.
-
To builds the app for production
npm run build
oryarn build
. It will create thebuild/
folder inside this project directory. It correctly bundles React hooks material in production mode and optimizes the build for the best performance. The build is minified and the file names include the hashes. Your app is ready to be deployed.
{% hint style="success" %}
The project was built assuming it is hosted at the server root folder of domain/platform i.e http://example.com
.
You can control this with the homepage field in your package.json
. To deploy build for sub-folder i.e http://example.com/folder-name/
than "homepage" : "http://example.com/folder-name/".
You also need to set base-name <BrowserRouter basename="folder-name">
in fileconstant.js
at '../src/config/' directory, like
export const BASENAME = '/materially';
{% endhint %}
You can find detailed instructions on using Create React App and many tips in its documentation.
{% hint style="info" %} You’ll need to have Node v12.x.x or later on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to easily switch Node versions between different projects. {% endhint %}