npm install --save @dlghq/dialog-components
import React from 'react';
import { render } from 'react-dom';
import { Avatar } from '@dlghq/dialog-components';
const container = document.getElementById('container');
render(
<Avatar
title="Hipster Partycat"
image="https://octodex.github.com/images/hipster-partycat.jpg"
/>,
container
);
For some complex components, like AuthForm
you should wrap your components tree
by @dlghq/react-l10n
Provider
component.
Before publishing we generate messages.json
bundle, which you should pass to Provider
.
import React from 'react';
import { render } from 'react-dom';
import { Provider } from '@dlghq/react-l10n';
import dialogMessages from '@dlghq/dialog-components/src/messages.json';
import appMessages from './messages';
const container = document.getElementById('container');
const messages = { ...dialogMessages, ...appMessages };
render(
<Provider messages={messages} locale={navigator.language}>
<App />
</Provider>,
container
);
NPM scripts:
npm start
start dev servernpm run create
create new componentnpm test
run testsnpm run lint
run lintersnpm run format
run formattersnpm run build
build docs & librarynpm run release
build & publish to npm & publish to gh-pages