-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Problem
Class Component did not re-render, but Functional Component did re-render, when providing context is changed, to put it like React Component.
Steps To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
First, clone My Repository and run app(you may think filename(in-repo) is strange, don't worry about it.).
git clone https://github.com/usagrada/yew-todo-app.git
git checkout 23f46839197dca3ec7588dcd42a3b63f3348b919
trunk serve --openThen, click the upper table and also click the lower table.
Then, open the code of src/pages/museum.rs and comment out lines 147 & 150.
After this comment-out, the class component's table was not re-rendered.
It is strange that td tag allows to have two onclick methods, I thought.
// let update = ctx.link().callback(|_| MuseumProviderMessage::Msg);
html! {
<td
// onclick={update}
onclick={&click}
>
{field.state[i][j]}
</td>
}Expected behavior
A clear and concise description of what you expected to happen.
class component runs equally to the function component, not emit message in subscribed component
FieldView
Screenshots
If applicable, add screenshots to help explain your problem.
each table was 1 clicked

Environment:
- Yew version: [v0.19.3]
- Rust version: [1.59.0,
nightly]
Questionnaire
- I'm interested in fixing this myself but don't know where to start
- I would like to fix and I have a solution
- I don't have time to fix this right now, but maybe later