last day (15 days later) » 

6:19 PM
hi
 
hi
are you here?
todos i tododetails are separate components
click todo1 --> display tododetails for todo1
 
yeah
 
click todo2 --> display tododetails for todo2
in tododetails is stopwatch
click button add new times
new times assign to choose todo
when I click todo1 I have access to object todo1
example var todo1 = this.state.todos[index]
how move variable todo1 to component detailsTodo?
 
I'll be with just now
 
in detailstodo I assign 'new times' to variable todo1
how move object todo1 to component tododetails?
component clock
I have access to todo1 when I click todo1
in component clock this.props.todos[this.props.selec]
componentDidMount() {
this.setState({
selectTodo: this.props.todos[this.props.selec]
})
but if i click todo 2 I don't have access to todo2
because I use componentDidMount
before render component
hoe set selectTodo? beside componentDidMount
You know what I mean? :)
I can not explain it differently
I have access to the first clicked element componentDidMount() {
this.setState({
selectTodo: this.props.todos[this.props.selec]
})
I can't use componentDidMount()
how to change the state: selectTodo: this.props.todos[this.props.selec]
?????
I tried to place component 'tododetails' in component 'todo'
But I do not know if this is a good idea?
Maybe I have a bad structure of components? What do you think after this drawing?
I tried to place component 'tododetails' in component 'todo'
 
Ok, I see it and understand
 

last day (15 days later) »