Files
twenty/front/src/modules/ui/utilities/recoil-scope/utils/createScopedState.ts
Lucas Bordeau 22451a68b3 Refactor/scope and context (#1960)
* wip

* Test with Dropdown

* wip

* wip

* Finished removing DropdownRecoilScopeContext

* Fix from PR
2023-10-11 15:35:47 +02:00

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,
});
};