Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Expose a wrapper for createComponent #498

@bmdalex

Description

@bmdalex

Expose a wrapper for createComponent

Problem description

We need to enable users of the library to leverage Stardust capabilities, styling especially, in their own components or 3rd party components.

Proposed solution

  • create a thing wrapper function with the same name on top of createComponent;
  • export it in index file;
  • create relevant doc site example / prototype; thoughts?
  • the signature of the function should be:
import createComponentInternal from './createComponent'

export interface CreateComponentWrapperConfig<P> {
  displayName: string
  render: (props: P & { styles: ComponentSlotStylesPrepared }) => React.ReactNode
}

const createComponent = <P extends {} = {}>({
  displayName,
  render,
}: CreateComponentWrapperConfig<P>): React.SFC<P> => createComponentInternal({ displayName, render })

export default createComponent

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions