0.1.1 • Published 1 year ago

@davide-angelillo/react-component-library v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

React Component Library

Usage

npm install @fabrick/react-component-library --save
// MyComponent.tsx
import {FbkElement} from "@fabrick/react-component-library";
//...
return <FbkElement foo={foo} bar="bar"/>

Development

In order to make design-system web-components work with React, you must create its React wrapper in the this library by creating a new .ts file that looks like this:

import {FbkComponentName as FbkComponentClass} from '../../../component-library/src/components/fbk-component'

export const FbkComponentName = createComponent({ // should be the same of the element class
  tagName: 'fbk-element-tag-name',
  elementClass: FbkComponentClass,
  react: React,
  events: {
    onCountClick: 'on-count-click' // remapping events in camelCase
  }
});

Publishing

Please read the project's root README.md

0.1.1

1 year ago

0.1.0

1 year ago