1.3.2 • Published 9 years ago

reacon v1.3.2

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Reacon - React component notation

Circle CI semantic-release

Use reacon to compile a plain json object into a composite React component.

npm install reacon

Examples

import { reactify, inflater } from 'reacon';

const inflate = inflater({
  inliners: [],
  modifiers: [],
});

const inflated = inflate([
  {
    type: 'modifier',
    props: {
      resource: 'A',
    },
  },
  {
    type: 'div',
    props: {
      children: {
        {
          type: 'p',
          props: {
            children: 'This is a paragraf',
          },
        },
        {
          type: 'p',
          props: {
            children: 'TEMPLATE Interpolate with ${value}',
          },
        },
      },
    },
  },
]);

const Component = reactify(inflated);

return <Component value="props" />;

Will produce the following:

<div>
  <p>This is a paragraph</p>
  <p>Interpolate with data and props</p>
</div>

reactify can also be extended with custom components.

const MyComponent = ({ arg }) => {
  return <div>{arg}</div>;
};

const injectable = reactify({
  component: 'MyComponent',
  arg: 'Hello',
}, { MyComponent });

Which will produce:

<div>Hello</div>
1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago