Component with children

Any component deriving from RxComponent can render anything in its Render() overload.

Sometimes is useful a component that arranges children.

Say we want for example to create a component that arranges its children within a customizable grid, like this:

To start let's create a component that build our page:

This should show a page with a title; let's now create a component for our grid (call it WrapGrid)

Every RxComponent can access its children using Children() method (like {this.props.children} in react)

Now let's add a ColumnCount property and a simple logic to arrange and wraps any children passed

Finally we just need to create the component from the page:

Last updated

Was this helpful?