Update recoil v4 states to getters (#3451)
Update v4 states to getters Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -15,6 +15,6 @@ export const useTabListStates = ({ tabListScopeId }: useTabListStatesProps) => {
|
||||
|
||||
return {
|
||||
scopeId,
|
||||
activeTabIdState: getState(activeTabIdStateScopeMap, scopeId),
|
||||
getActiveTabIdState: getState(activeTabIdStateScopeMap, scopeId),
|
||||
};
|
||||
};
|
||||
|
||||
@ -3,14 +3,14 @@ import { useSetRecoilState } from 'recoil';
|
||||
import { useTabListStates } from '@/ui/layout/tab/hooks/internal/useTabListStates';
|
||||
|
||||
export const useTabList = (tabListId?: string) => {
|
||||
const { activeTabIdState } = useTabListStates({
|
||||
const { getActiveTabIdState } = useTabListStates({
|
||||
tabListScopeId: `${tabListId}-scope`,
|
||||
});
|
||||
|
||||
const setActiveTabId = useSetRecoilState(activeTabIdState());
|
||||
const setActiveTabId = useSetRecoilState(getActiveTabIdState());
|
||||
|
||||
return {
|
||||
activeTabIdState,
|
||||
getActiveTabIdState,
|
||||
setActiveTabId,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user