How can I dynamically render different content with clicking on different buttons.
I am trying to create schedule which by clicking on Monday button will show only exercises and time for Monday, by clicking on Thursday it will show only exercise and time for Thursday and so on.
Live example is here https://www.free-css.com/free-css-templates/page228/stamina
On schedule part.
I have this code so far, is not much but...
import React from 'react';
class Monday extends React.Component {
constructor (props) {
super(props)
this.state = { show: true };
this.toggleDiv = this.toggleDiv.bind(this)
}
toggleDiv = () => {
const { show } = this.state;
}
render () {
return (
<div>
<button onClick={ this.toggleDiv } >
Monday
</button>
{this.state.show && <Box1 />}
</div>
);
}
}
class Box1 extends React.Component{
render(){
return(
<div>
Monday time
</div>
)
}
}
export default Monday;
I have tried same thing with Thursday, just applying this code on Thursday but only one default export allowed per module.
How can I edit code to apply it for all days?
only one default export allowed per module.@venu