Skip to content

Add an option to avoid initial render of content #63

@brillout

Description

@brillout

Currently the following will log I am being rendered.

const MyComponent = React.createClass({render: () =>
  console.log('I am being rendered') || <span>content</span>
});

<Collapse isOpened={false}>
  <MyComponent />
</Collapse>

In case of many initially collapsed elements, it can be a considerable performance penalty to render all collapsed content.

An option could determine if these should be initially rendered.
Although I'm not sure why someone would want to initially render a hidden element.

Alternatively, a solution would be to implement #19 as an option. The following construct would then achieve the wished behavior.

let isOpened = false;
<div>
  { isOpened && <Collapsed isOpened={isOpened} initallyAnimate={true}>content</Collapse>}
</div>

Thanks for <Collapase/> btw :-)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions