@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
16 lines (13 loc) • 429 B
JavaScript
import { useReducer } from 'react';
function useRerender() {
const [key, update] = useReducer(
// This implementation works by incrementing a hidden counter value that is
// never consumed. Simply incrementing the counter changes the component's
// state and, thus, trigger a re-render.
(key2) => key2 + 1,
0
);
return [update, key];
}
export { useRerender };
//# sourceMappingURL=use-rerender.js.map