Introduce ComponentState (#4386)
* Proof of concept ComponentState * Migrate to createState and createFamilyState * Refactor * Fix * Fix tests * Fix lint * Fix tests * Re-enable coverage
This commit is contained in:
@ -3,7 +3,7 @@ import { useRecoilState } from 'recoil';
|
||||
import { iconPickerState } from '../states/iconPickerState';
|
||||
|
||||
export const useIconPicker = () => {
|
||||
const [iconPicker, setIconPicker] = useRecoilState(iconPickerState);
|
||||
const [iconPicker, setIconPicker] = useRecoilState(iconPickerState());
|
||||
|
||||
return {
|
||||
Icon: iconPicker.Icon,
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { IconApps } from '@/ui/display/icon';
|
||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||
import { createState } from '@/ui/utilities/state/utils/createState';
|
||||
|
||||
type IconPickerState = {
|
||||
Icon: IconComponent;
|
||||
iconKey: string;
|
||||
};
|
||||
|
||||
export const iconPickerState = atom<IconPickerState>({
|
||||
export const iconPickerState = createState<IconPickerState>({
|
||||
key: 'iconPickerState',
|
||||
default: { Icon: IconApps, iconKey: 'IconApps' },
|
||||
defaultValue: { Icon: IconApps, iconKey: 'IconApps' },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user