You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possibility to give custom render method of Accordion a different dataArray.
In the current code the renderHeader prop receives item.title and renderContent prop receives item.content.
It would be more flexible to add the whole array of data to a custom render. This way it would be possible to use data which was fetched via an api call and display that in the custom accordion.
The line to change is in Accordion.js line 102, 103
from: {this.props.renderHeader ? ( this.props.renderHeader(this.props.item.title, this.props.expanded)
to: {this.props.renderHeader ? ( this.props.renderHeader(this.props.item, this.props.expanded)
and line 119, 120
from: {this.props.renderContent ? ( this.props.renderContent(this.props.item.content)
to: {this.props.renderContent ? ( this.props.renderContent(this.props.item)
is there a reason why it is limited to the keys title and content?
The text was updated successfully, but these errors were encountered:
This should ideally be reflected in the documentation for the custom header and content, as it shows the old behaviour of receiving simply the Title and Content variables.
Possibility to give custom render method of Accordion a different dataArray.
In the current code the renderHeader prop receives item.title and renderContent prop receives item.content.
It would be more flexible to add the whole array of data to a custom render. This way it would be possible to use data which was fetched via an api call and display that in the custom accordion.
The line to change is in Accordion.js line 102, 103
from:
{this.props.renderHeader ? ( this.props.renderHeader(this.props.item.title, this.props.expanded)
to:
{this.props.renderHeader ? ( this.props.renderHeader(this.props.item, this.props.expanded)
and line 119, 120
from:
{this.props.renderContent ? ( this.props.renderContent(this.props.item.content)
to:
{this.props.renderContent ? ( this.props.renderContent(this.props.item)
is there a reason why it is limited to the keys title and content?
The text was updated successfully, but these errors were encountered: