React component boilerplate code generator with typescript.
- Install the extension here.
- Open command pallete
Ctrl + Shift + P
(windows) orCmd + Shift + P
(mac). - Search
Create React Component
and hit enter. - Enter path of the component eg
src/components
. This is the parent folder inside which your component will be created. - Enter name of the component eg
Header
. This is the component name and the folder which will contain the component
import { render } from '@test-utils';
import { Header } from './Header';
describe('Header', () => {
it('should render properly', () => {
const { container } = render(<Header />);
expect(container).toMatchSnapshot();
});
});
import { FC, memo } from 'react';
export const Header: FC = memo(() => {
return <></>;
});
Header.displayName = 'Header';
export { Header as default } from './Header';
export type Props = {
// component prop type
click: () => void
};
The project is open to all sort of contributions.