Extension provide two features:
- Generate
index.ts
file - Snippets for react/ts/tanstack-query
This feature generate index.ts
in same directoryt with export statement based on filename of activetab.
e.g: we are on MyComponent.tsx
tab, and run feature. index.ts
will be:
export { MyComponent } from './MyComponent';
Run:
- Press
ctrl+shift+\
- keybinding - Run
shireee.generateIndex.ts
- Command Palette
const [|, set|] = useState<|>(|);
export const |: React.FC = () => {
return <> |</>;
};
interface |Props {}
export const |: React.FC<|Props>= () => {
return <> | </>;
};
const handle| = (|) => {
/*statement*/
}
export { | } from '.|';
"export * from '.|';
import { useMutation } from '@tanstack/react-query';
export function use|() {
return useMutation({
mutationKey: [|],
mutationFn: (|) => {
/*statement*/
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: [|] });
},
});
}
import { useQuery } from '@tanstack/react-query';
export function useAction(|) {
return useQuery({
queryKey: [|],
queryFn: () => {
/*statement*/
},
});
}