@citrus327/with-default-props
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@citrus327/with-default-props

Download Version

a HOC that applies default props to React component

Installation

pnpm install @citrus327/with-default-props

Usage

import { withDefaultProps } from '@citrus327/with-default-props'

interface SimpleProps {
  word?: string
}

export const Simple: React.FC<SimpleProps> = (props) => {
  return <h1>Hello{props.word}</h1>
}


const Wrapped = withDefaultProps(Simple, {
  word: " world",
})

Readme

Keywords

none

Package Sidebar

Install

npm i @citrus327/with-default-props

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

6.36 kB

Total Files

8

Last publish

Collaborators

  • hophop0327