Skip to content

Commit f1f47c0

Browse files
authored
chore: migrate injectionsState to jotai (#4127)
1 parent 1cc931a commit f1f47c0

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/components/Extensibility/useGetInjection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { useRecoilValue } from 'recoil';
1+
import { useAtomValue } from 'jotai';
22
import { injectionsState } from 'state/navigation/extensionsAtom';
33

44
export const useGetInjections = (location, slot) => {
5-
const injections = useRecoilValue(injectionsState);
5+
const injections = useAtomValue(injectionsState);
66
let filteredInjections = [];
77

88
(injections || []).forEach(injection => {

src/state/navigation/extensionsAtom.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export const useGetExtensions = () => {
411411
const setExtensions = useSetRecoilState(extensionsState);
412412
const setStatics = useSetRecoilState(staticsState);
413413
const setAllExtensions = useSetAtom(allExtensionsState);
414-
const setInjections = useSetRecoilState(injectionsState);
414+
const setInjections = useSetAtom(injectionsState);
415415
const setWizard = useSetAtom(wizardState);
416416
const fetchFn = getFetchFn(useRecoilValue);
417417
const configuration = useRecoilValue(configurationAtom);
@@ -596,12 +596,8 @@ export const staticsState: RecoilState<ExtResource[] | null> = recoilAtom<
596596
export const allExtensionsState = atom<ExtResource[] | null>(defaultValue);
597597
allExtensionsState.debugLabel = 'allExtensionsState';
598598

599-
export const injectionsState: RecoilState<
600-
ExtInjectionConfig[] | null
601-
> = recoilAtom<ExtInjectionConfig[] | null>({
602-
key: 'injectionsState',
603-
default: defaultValue,
604-
});
599+
export const injectionsState = atom<ExtInjectionConfig[] | null>(defaultValue);
600+
injectionsState.debugLabel = 'injectionsState';
605601

606602
export const wizardState = atom<ExtWizardConfig[] | null>(defaultValue);
607603
wizardState.debugLabel = 'wizardState';

0 commit comments

Comments
 (0)