refactoring
useEffect(fn, []) is not the new componentDidMount()
They’re actually mechanically different, so you might not get what you expect if consider . . .
Refactoring a Complex React Component — 5 Best Practices to Write Efficient and Readable Components
Prefer functional components with React Hooks DRY – Try to extract common things into another . . .
Tips for Writing Self-Documenting Code
Always give a name for numbers Use clear variable names Refactor with tiny, named functions Add . . .