Skip to main content
100%

React Container View

✓ Published0🌍 Public
Aandresmijares
Last edited Mar 19, 2017
Created on Mar 19, 2017

This example shows a React container component that manages order data and passes it to a child list component for rendering. The container uses `React.createClass` to define local state initialized with `getInitialState`, then populates that state via `componentDidMount` with `setOrderInfo`, which reads from the component’s props. It defines a `create` method that clones an order object with `Object.assign` and calls `this.model.create`. The `render` method returns a `<ListOrdersComponent>` receiving the model, state, orders, and create handler. A `mapStateToProps` function selects the `orders` slice from a Redux-style state, though no store connection is shown.

AI-generated description

Similar vizzes