I've a react code as shown below in which I want to build a Timezonepicker. On clicking particular timezone, it should display all list related to it.
React Code:
const timezones = [moment.tz("America/Toronto").format('z'), 'PT', 'MT', 'CT', 'ET', 'AT', 'NT'];
const Helloworld = (props) => {
return (
timezones.map((timezone) => {
<a onClick = {
(e) => {
e.preventDefault();
props.onChange(timezone)
}
} > timezone < /a>
})
)
}
return(
<VersionPageHolder>
{
<Helloworld onChange={(timezone) => {
setSelectedTimezone(timezone);
}}
/>
}
<div>{content.title}</div>
<div>Version List : </div>
<div>{
renderElements(selectedTimezone)
}</div>
</VersionPageHolder>
)
The react code above doesn't show list of timezones (PT, MT, CT, ET, AT, NT). With the code above. At this moment, I am currently seeing:
timezone timezone timezone timezone timezone timezone