rsnext/examples/only-client-render-external-dependencies/components/BarChart.js
Tim Neutkens 9c4eefcdbf
Add prettier for examples directory (#5909)
* Add prettier for examples directory

* Fix files

* Fix linting

* Add prettier script in case it has to be ran again
2018-12-17 17:34:32 +01:00

13 lines
387 B
JavaScript

import dynamic from 'next/dynamic'
export default dynamic({
modules: () => ({
BarChart: import('recharts').then(({ BarChart }) => BarChart),
Bar: import('recharts').then(({ Bar }) => Bar)
}),
render: (props, { BarChart, Bar }) => (
<BarChart width={props.width} height={props.height} data={props.data}>
<Bar dataKey='uv' fill='#8884d8' />
</BarChart>
)
})