Changelog
🐞 Bug Fixes
- docz-theme-default: table margin bottom (36e322f)
- docz-theme-default: use class inside playground (cecbea1) (closes #261)
🚀 Features
- docz-theme-default: add style for hr component (5b24400)
- docz-theme-default: hide playground editor by default (0ccda92)
Rendering class inside <Playground>
Now you can render classes inside playground just by declaring a class, like that:
import { Playground } from 'docz'
<Playground>
{class Counter extends React.Component {
constructor() {
super()
this.state = { count: 0 }
}
componentDidMount() {
this.interval = setInterval(() => {
this.setState(state => ({ count: state.count + 1 }))
}, 1000)
}
componentWillUnmount() {
clearInterval(this.interval)
}
render() {
return (
<center>
<h3>
{this.state.count}
</h3>
</center>
)
}
}}
</Playground>