This is a lesson about ReactJS Forms. Please follow the steps below to get started.
- Set up your environment: See "Quick Setup" to get started by cloning this repo or see "Set Up From Scatch" below to get started from scratch.
- Create A Sample Form Component
create-react-app react-forms
cd react-forms
code .
- StyleGuidist
npm install --save-dev react-styleguidist
- Semantic-UI-React
npm install semantic-ui-react
- Semantic-UI-CSS
npm install semantic-ui-css
- React-Router-Dom
npm install --save react-router-dom
- JSON Server
npm i json-server
- WebPack: See next step
After installing dependencies, place the following line of code under devDependencies in your package.json
"webpack": "^3.8.1"
npm i
import 'semantic-ui-css/semantic.min.css';
mkdir src/components
mkdir src/styles
touch src/styles/styleguidist.css
touch styleguide.config.js
module.exports = {
components: 'src/components/**/*.js',
// ignore: ['**/components/views/*.js'],
ribbon: {
url: 'http://github.com/drteresavasquez',
text: 'See App In Action'
},
template: {
favicon: './public/favicon.ico',
head: {
links: [
{
rel: 'stylesheet',
href: './node_modules/semantic-ui-css/semantic.min.css'
},
{
rel: 'stylesheet',
href: './src/styles/styleguidist.css'
}
]
}
},
theme: {
color: {
link: 'white',
linkHover: 'salmon',
sidebarBackground: '#000000',
},
fontFamily: {
base: '"Droid Sans"',
},
fontSize:{
small: 13,
}
}
};
Note: You can npm i concurrently and set up your app to take one command to start all servers.
npx styleguidist server
npm start
json-server --watch -p 4000 db.json