@davide-angelillo/react-component-library
v0.1.1
Published
React web-components wrapper for @fabrick/component-library
Maintainers
Readme
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
