@teamsparta/react
v2.3.3
Published
유틸리티성의 React Component와 Hook들을 제공합니다.
Downloads
942
Maintainers
Keywords
Readme
@teapsparta/react
유틸리티성의 React Component와 Hook들을 제공합니다.
Getting Started
npm install @teamsparta/react # npm
yarn add @teamsparta/react # yarn
pnpm add @teamsparta/react # pnpm
Usage
components
- SwitchCase
cases에서 value에 해당하는 컴포넌트를 렌더링합니다. 만약 존재하지 않는 case일 경우 defaultComponent를 렌더링합니다.
<SwitchCase
value={color}
cases={{
'red': <Category color='red'>Dangerous</Category>
'green': <Category color='green'>Safe</Category>
}}
defaultComponent={<Category color='blue'>Just</Category>}
/>