We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group related state
const [x, setX] = useState(0); const [y, setY] = useState(0);
const [position, setPosition] = useState({x:0, y:0});
you won’t forget to always keep them in sync
Best practice on organizating state
The text was updated successfully, but these errors were encountered:
Avoid contradictions in state: In short, Prefer to use state machine
Avoid redundant state:
const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const [fullName, setFullName] = useState('');
const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const fullName = `${firstName} ${lastName}`
Avoid duplication in state: ( do not store the same information at two places)
Avoid deeply nested state: example
Sorry, something went wrong.
No branches or pull requests
General tips
Group related state
you won’t forget to always keep them in sync
Best practice on organizating state
The text was updated successfully, but these errors were encountered: