This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const panels = this.state.panels.map(panel => ( | |
<ExpansionPanel key={panel.key}> | |
<ExpansionPanelTitle>{panel.title}</ExpansionPanelTitle> | |
<ExpansionPanelContent>{panel.body}</ExpansionPanelContent> | |
</ExpansionPanel> | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, cloneElement, Children } from "react"; | |
class ExpansionPanel extends Component { | |
state = { | |
show: false | |
}; | |
toggleContent = () => { | |
this.setState(prevState => ({ | |
show: !prevState.show | |
})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const expansionPanelTitle = props => ( | |
<div style={{ border: "1px solid red" }} onClick={props.onClick}> | |
{props.children} | |
</div> | |
); | |
export default expansionPanelTitle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const expansionPanelContent = props => { | |
return <div style={{ border: "1px solid blue" }}>{props.children}</div>; | |
}; | |
export default expansionPanelContent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const panels = this.state.panels.map(panel => ( | |
<ExpansionPanel key={panel.key}> | |
<ExpansionPanelTitle>{panel.title}</ExpansionPanelTitle> | |
<ExpansionPanelContent>{panel.body}</ExpansionPanelContent> | |
</ExpansionPanel> | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const items = {name: "Daniele", surname: "Zurico", sex: "male"}; | |
// or | |
const items = ["Daniele", "Zurico", "male"]; | |
//or | |
const items = new Map([ | |
["name": "Daniele"], | |
["surname": "Zurico"] | |
]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li *ngFor="let item of Items | keyvalue"> | |
{{item.key}}: {{item.value}} | |
</li> | |
</ul> |