UNPKG

@proca/widget

Version:

Proca is an open-source campaign toolkit designed to empower activists and organisations in their digital advocacy efforts. It provides a flexible and customisable platform for creating and managing online petitions, email campaigns, and other forms of di

22 lines (18 loc) 540 B
import React from "react"; import { Button } from "@material-ui/core"; import { useRecoilCallback } from "recoil"; const DebugButton = () => { const onClick = useRecoilCallback( ({ snapshot }) => async () => { console.debug("Atom values:"); for (const node of snapshot.getNodes_UNSTABLE()) { const value = await snapshot.getPromise(node); console.debug(node.key, value); } }, [] ); return <Button onClick={onClick}>Dump State</Button>; }; export default DebugButton;