Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in the TwoApps showcase example #1078

Merged
merged 2 commits into from Apr 13, 2020

Conversation

bryanjswift
Copy link
Contributor

The "two apps" part of the two_apps example is now implemented in both two_apps/src/main.rs and in the TwoModels component of two_apps/src/lib.rs. The TwoModels::mounted implementation mimics the work done in main.rs of the example. The TwoModels struct and implementation are the same in both the web_sys and std_web examples.

Fixes #201

b4d5227 changed the name of
`Msg::SetScope` to `Msg::SetOpposite` but the usages in the `main`
functions of the `two_apps` examples were not updated.
`TwoModels` is a `Component` that does not respond to changes but which
creates two instances of the `Model` and mounts them as separate
`yew::App<Model>` instances in the body. This is done to mimic the
behavior of `two_apps/src/main.rs` which uses a static `index.html` file
containing the `div.first-app` and `div.second-app` elements.
`TwoModels::mounted` is responsible for replacing the `<div>` nodes it
creates during the initial render with the `Model` components.
@bryanjswift
Copy link
Contributor Author

I was not able to reproduce the errors described in the other showcase examples in my local testing. I suspect that #1071 cleared up the error with the LargeTable example. GameOfLife did not panic for me while running (though it's possible I didn't use the correct settings or let it run long enough). NpmAndRest successfully completed both requests.

@jstarry jstarry merged commit 9651d07 into yewstack:master Apr 13, 2020
@jstarry
Copy link
Member

jstarry commented Apr 13, 2020

Wow, you just knocked out a 2 year old issue! Thanks so much :)

@bryanjswift bryanjswift deleted the showcase-errors branch April 14, 2020 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

errors in showcase
2 participants