fsd-react-snippets
Сниппеты
const cva$1 = cva([
'ComponentName-cva$1',
'$2',
]);
import { FC } from 'react';
import { cva } from 'class-variance-authority';
interface Props {
}
const cvaRoot = cva(['ComponentName-cvaRoot', '']);
const ComponentName: FC<Props> = () => {
return (
<div className={cvaRoot()}>,
{$1}
</div>
)
}
export default ComponentName
import { create } from 'zustand';
interface TypeState {
test: string | null;
}
interface TypeActions {
setTest: (string | null) => void;
},
export const useStore = create<TypeState & TypeActions>(
(set) => ({
test: null,
setTest: (val) => {
set(() => {
return {
val
};
})
},
})
);
Enjoy!
| |