Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Reacon v3

Daniel Werthén edited this page Oct 14, 2016 · 2 revisions
{
  identifier: 'FooBar',
  displayName: 'FooBar',
  content: {
    elementName: 'div',
    children: [
      {
        elementName: 'p',
        children: 'Foo',
      }
    ],
  },
  defaultProps: {
    static: true,
  },
}
function FooBar() {
  return <div><p>Foo</p></div>;
}
FooBar.displayName = 'FooBar';
FooBar.defaultProps = ...;
return FooBar;
{
  identifier: 'FooBar',
  displayName: 'FooBar',
  content: {
    elementName: 'div',
    children: [
      {
        elementName: 'p',
        children: '{props.name}',
      }
    ],
  },
  higher: [
    {
      type: 'connect',
      arguments: [
        {
          type: 'query',
          arguments: [
           { name: 'state.data.name' }
          ],
        }
      ],
    },
  ],
  defaultProps: {
    static: true,
  },
}
function FooBar(props) {
  return <div><p>{props.name}</p></div>;
}
FooBar.displayName = 'FooBar';
FooBar.defaultProps = ...;
return connect(query({ name: 'state.data.name' }})(Foobar);

Clone this wiki locally