rpominov / react-demo

A React-component for creating demos of other components
MIT License
99 stars 9 forks source link

Nesting props #31

Open rpominov opened 8 years ago

rpominov commented 8 years ago
import Demo, {props as P} from 'react-demo'

<Demo
  ...
  props={{
    foo1: P.object({
      bar: P.string('bar'),
      baz: P.callback.log(),
    }),
    foo2: P.arrayOf(P.string('bar')),
    foo3: P.arrayOf(P.object({
      bar: P.string('bar'),
      baz: P.callback.log(),
    })),
  }}
/>
rpominov commented 8 years ago

Related: https://github.com/rpominov/react-demo/pull/38

cedricdelpoux commented 7 years ago

It could be perfect !