Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- state={
- panelData:[
- { title:"title"
- content:["one",2]
- }
- ]
- }
- panelData: [ {title:"title",content:["one",2]} ,
- {title:"title 2"content:[3,4]} ]
- handlingAddRecipe(){ //this is my update paneldata function
- let contentValue = this.state.recipeContent.join("").split(","); //contentValue = ["content1","content2"]
- this.setState({
- panelData:[{
- title:this.state.recipeTitle, //title:"title1"
- content:contentValue //content:contentValue
- }]
- })
- console.log(this.state.panelData)
- }
Add Comment
Please, Sign In to add comment