MCPcopy
hub / github.com/marmelab/react-admin / MyComponent

Function MyComponent

packages/ra-core/src/store/useStore.spec.tsx:129–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 );
128 };
129 const MyComponent = () => {
130 const [storeKey, setStoreKey] = React.useState('list1');
131 return (
132 <StoreContextProvider value={memoryStore({})}>
133 <StoreConsumer storeKey={storeKey} />
134 <button onClick={() => setStoreKey('list2')}>
135 change key
136 </button>
137 </StoreContextProvider>
138 );
139 };
140 render(<MyComponent />);
141 expect(screen.queryByText('hello')).toBeNull();
142 fireEvent.click(screen.getByText('change value'));

Callers

nothing calls this directly

Calls 1

memoryStoreFunction · 0.90

Tested by

no test coverage detected