Skip to content
Junior–Senior163 views

State toggle timeout when input data changes

Asked at

Task condition

The component receives a prop data, which can be updated. Each time data changes, a delay of 3 seconds should be triggered, after which the focusState state toggles.

const App = ({ data }) => {
    const [focusState, setFocusState] = useState(false);
    return null;
}
Frontend tasks in the code trainer