Skip to content

CMF Container Components guidelines

Jean-Michel FRANCOIS edited this page Apr 27, 2017 · 3 revisions

Before contributing to the stack you should read that first.

Components

  1. All components here must be pure and don't have any state.

  2. A snapshot tests should never have more than 20 lines of HTML. (prefer shallow rendering instead of mount or react-renderer)

  3. Expose renderers props to let the user customize sub components Note: this is a new rule, at the moment only the ActionBar implement it https://github.com/Talend/ui/pull/414

Containers

A container is a component which extended an existing pure component (often in react-talend-components).

  1. The API (props) should by default support the same API as the pure component. The container should only add new props. If you fill the need to change the shape of the props ensure the original shape is still supported.

  2. The container should support the same customization as the pure one exposing the sub components;

  3. The container should inject extended sub components using the renderer props.

  4. Most of the time use cmfConnect instead of connect to have cmf behavior.

CMF