I am going to convert one JavaScript component I have, into TypeScript but I am new to TypeScript and I do not know where I have to start for converting my JavaScript component to TypeScript.
I put just the main parts of component into my question but briefly my component includes:
Mycomponent:
class App extends React.Component {
state = { sections: [
{
"title": "Popular",
"items": [
{
"name": "Lorem",
"online": true,
} ]
}
]
}
render() {
var sections = this.state.sections.map(function(section, index) {
return (
<div className="container-fluid">
<Section section={section} key={index}/>
</div>
)
});
return(
<div> {sections} </div>
)
}
}
export default App;
How can I have this JavaScript Component in TypeScript?