useResetStore

This hook allows to empty the Store. React-admin uses it at logout.

Syntax

import { useResetStore } from 'react-admin';

const reset = useResetStore();
reset();

Example

import { useResetStore, Button } from 'react-admin';

const ResetButton = () => {
    const reset = useResetStore();
    return (
        <Button onClick={() => reset()}>
            Reset store
        </Button>
    );
};