Fullstack GraphQl + react unstyled framework
- install visual studio code and setup devcontainers
- select reopen in dev container when it pops up
- run
terminal > open terminal
- run
cd frontend/backend
- run
npm start
- frontend
- react application
- backend
- GraphQl application
- lint on save with eslint should be configured in visual studio code
All code is in the src
folder
MNML's component library Unique, repeated patterns of ui within the application.
See primitives/Grid
for an example
- PascalCaseFolder
- index.tsx (barrel file )
- PascalCaseReactComponent.tsx
- OtherComponents.tsx
- someState.tsx
- someHook.tsx
- define an interface for the props props in MNML should only be used for configuring the component. To bring data into a component a hook should be used instead.
export interface GridProps {
// props
sx: SerializedStyles // TODO: change type
}
- Each component file can define multiple
@emotion/styled
components on an as needed basis. useRoot
as the name for a base styled component for consistency
// any is used here for custom values without defining a new type. Probably a better way
const Root = styled('div')(({ columns, rows, gap, sx }: any) => {
return {
rows, // prop from the parent component
gap, // prop from the parent component
// styling
...sx // override styling (possibly will be replaced with the css prop)
}
});
- type your components,
export const Grid: FC<GridProps> = (props) => {
const childCount = Children.count(props.children)
const {
children,
columns,
sx
} = props;
return (
<Root
sx={sx.root} // use keys to change styles for a single component
columns={c}
rows={r}
>
{children}
</Root>
)
}
groupings of related logic/components
Images go here
Unique utility functions
Unique utility React hooks