At least you need have these configs in .babelrc
and install them.
// .babelrc
{
"presets": [
"env",
"es2015",
"stage-0",
"react"
],
"plugins": [
"transform-decorators-legacy"
]
}
npm install react-singleton-decorator --save
import singleton from 'react-singleton-decorator';
@singleton
class Hello extends Component {
render() {
const { name } = this.props;
return (
<div onClick={() => this.hide()}>
Hello, {name}!
</div>
)
}
}
Hello.show({
name: 'Lily'
});
Hello.hide();
Alert
Modal
Message
Notification
PageLoading
npm run example
npm run build