0.1.0 • Published 6 years ago
react-layout-state-renderer v0.1.0
ReactLayoutStateRenderer
Basic Example
import React from 'react';
import LayoutStateRenderer from 'react-layout-state-renderer';
const CustomComponent = () => <h1>Custom Component</h1>;
const layoutState = {
root: {
key: 'root',
type: 'div',
props: {},
metadata: {},
children: ['1'],
},
'1': {
key: '1',
type: 'CustomComponent',
props: {},
metadata: {},
children: [],
parent: 'root',
},
};
const MyComponent = () => (
<LayoutStateRenderer
layoutState={layoutState}
rootKey="root"
components={{ CustomComponent }}
/>
);
export default MyComponent;
0.1.0
6 years ago