React Hooks: Force Update

Date: 2021-11-30
import React, { useReducer, useState } from "react";

export function MyComponent(props: {}) {
    const [, forceUpdate] = useReducer(x => x + 1, 0);

    // somewhere..
    forceUpdate();
    
    return <></>;
}
57510cookie-checkReact Hooks: Force Update