thanks for your answer, and I was follow your code
import React, { Component } from 'react';
import { Tabs, TabPanel } from 'rc-easyui';
import { render } from 'react-dom';
var data = [];
class TabContent extends Component {
constructor(props){
super(props);
this.state = {
data: [
{
title: 'Tab1',
content: 'Content1'
},{
title: 'Tab2',
content: 'Content2'
},{
title: 'Tab3',
content: 'Content3'
}
]
};
}
handleAddTab(elem) {
/* action ketika action menu true */
this.state = {
data: [
{
title: 'Tab1',
content: 'Content1'
},{
title: 'Tab2',
content: 'Content2'
},{
title: 'Tab3',
content: 'Content3'
},{
title: 'Tab4',
content: 'Content4'
}
]
};
}
render() {
return (
<Tabs id="tabpanel" scrollable style={{ width: '100%', height: '100%' }} justified>
{
this.state.data.map((tab,index) => (
<TabPanel key={index} {...tab}>...</TabPanel>
))
}
</Tabs>
);
}
}
module.exports = TabContent;
Sorry this is my code. I'am new in react
handleAddTab is function will called from my sidebar file, I try to change data array with new data but its not got effect on my tabpanel
And, Please give me scrypt for render from other file imported on this tabpanel, Thank you very much