1. npm i -D prettier 2. create .prettierrc.json { "trailingComma": "all", "tabWidth": 2, "singleQuote": true, "jsxBracketSameLine": true, "semi": false } 3. npm i -D eslint-config-prettier 4. in package.json, add this: "eslintConfig": { "extends": [ "react-app", "react-app/jest", "prettier" ] }, 5. install extension in VS Code Prettier extension
const Dashboard : React . FC = () => { const store = createStore ( countReducer ) const divRef = useRef < HTMLDivElement >( null ); store . subscribe (() => { const state = store . getState () if ( divRef . current ) divRef . current . innerText = `this is cool, another listener: ${ state . count } ` ; }) return ( ... < button onClick = { () => store . dispatch ({ type : ActionType . INCREMENT }) } > add </ button > < button onClick = { () => store . dispatch ({ type : ActionType . DECREMENT }) } > minus </ button > < div ref = { divRef } > 0 </ div > ... ) } Re-Render: const count = useRef ( 0 ) ; useEffect ( ( ) => { count . current = count . current + 1 ; } ) ; return ( < > < input type = " text " value = { inputValue } onChange = { ( e ) => setInputValue ( e . target . value ) } /&g