Helps in creating your React component, generating files and boilerplates for its development.
- Install the extension.
- In your explorer, right-click and select Bayon Generate Component
- Enter the name of the component to be created in the input.
import React from 'react';
import * as Styles from './NameComponent.styles'
export const NameComponent = () => {
return (
<Styles.Container>
<div></div>
</Styles.Container>
);
};
import { styled } from '@bayon/commons';
export const Container = styled('div')(() => ({
display: 'flex',
boxSizing: 'border-box',
}));
export { NameComponent } from './NameComponent';
import React from 'react';
import { render, screen } from '@bayon/testing';
import { NameComponent } from './NameComponent';
describe('<NameComponent />', () => {
it('should render component', () => {
createComponent();
expect(screen.getByText('')).toBeInTheDocument();
});
});
const createComponent = (props = {}) => {
const defaultProps = {
...props,
};
return render(<NameComponent {...defaultProps} />);
};
GPL-3.0 © Joao Victor Faustino Piga Lopes