Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

@polymorphic-factory/react@0.3.0

Compare
Choose a tag to compare
Loading
@github-actions github-actions released this 28 Jan 14:12
· 430 commits to main since this release
0a493a1

Minor Changes

  • #192 bc0f72a Thanks @TimKolberger! - Fixed an issue where the factory options type polymorphicFactory<P, Options>() did not propagate
    to the factory function poly("div", options). This is possibly a breaking change for TypeScript
    users.

    type AdditionalProps = Record<never, never>
    type Options = { 'data-custom-option': string }
    
    const poly = polymorphicFactory<AdditionalProps, Options>({
      styled: (component, options) => (props) => {
        const Component = props.as || component
        return <Component data-custom-styled data-options={JSON.stringify(options)} {...props} />
      },
    })
    const CustomDiv = poly('div', { 'data-custom-option': 'hello' })
Morty Proxy This is a proxified and sanitized view of the page, visit original site.