Read style guide https://github.com/airbnb/javascript/tree/master/react
Bad
export default const Toolbar = ({ numSelected, classes }) => {
Good
export default const Toolbar = props => {
const { numSelected, classes } = props;
If you need to bind one handler function with arguments Bad
handlerClick = (arg) => {
//handle
}
render(){
return <TestComponent onClick={()=>{handlerClick(arg)}};
}
Good
handlerClick = () = (arg) => {
//handle
}
render(){
return <TestComponent onClick={handlerClick(arg)};
}
Folder /src/api
has scripts for working with server api.
Every module has own folder.
Modules list:
- aliance - contain components for working with aliances
- crm - contain components for working with CRM
- desktop - contain components for working with Desktop of application
- user - containt components for working with users
- app - contain components and utils for whole application
- util - contain useful functions, doesn't contain react components
Every module contain folder reducers, actions