* wip * Test with Dropdown * wip * wip * Finished removing DropdownRecoilScopeContext * Fix from PR
15 lines
262 B
TypeScript
15 lines
262 B
TypeScript
import { atomFamily } from 'recoil';
|
|
|
|
export const createScopedState = <ValueType>({
|
|
key,
|
|
defaultValue,
|
|
}: {
|
|
key: string;
|
|
defaultValue: ValueType;
|
|
}) => {
|
|
return atomFamily<ValueType, { scopeId: string }>({
|
|
key,
|
|
default: defaultValue,
|
|
});
|
|
};
|