Derived state in React
What is a derived state?
A derived state is a value that is computed from a state value. For example:
import React from 'react'
const Example: React.FC = () => {
const [counter, setCounter] = useState(0)
const doubleCounter = counter * 2
r...
danijelmaksimovic.com2 min read