Our great sponsors
-
storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Flexbox grids, buttons and padding/margin components are tedious to write from scratch every time you start a new project. They make good candidates for putting in their own npm library. Luckily scaffolding tools like tsdx make this a breeze.
import React, { FC, HTMLAttributes, ReactChild } from 'react'; import { Button, ButtonProps } from './Button/Button'; export interface Props extends HTMLAttributes { /** custom content, defaults to 'the snozzberries taste like snozzberries' */ children?: ReactChild; } // Please do not use types off of a default export module or else Storybook Docs will suffer. // see: https://github.com/storybookjs/storybook/issues/9556 /** * A custom Thing component. Neat! */ const Thing: FC = ({ children }) => { return
{children || `the snozzberries taste like snozzberries`}; }; export { Thing, Button, ButtonProps };
The final code is here if you want to compare your code.
Related posts
- Rawjs – you may not need React anymore
- 🎄 Top Front-End Frameworks in 2024 Worth Your Time and Effort to Master
- [AskJS] Which JS libraries and packages are currently your favourites?
- GitHub - Achaak/pikas: Pikas is an open source project that aims to provide a simple and easy to use to create a simple and fast web application.
- Better dev experience starts from a proper document