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

Update build-a-sample-app.mdx #3423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Jan-V2
Copy link

@Jan-V2 Jan-V2 commented Sep 28, 2023

Fixed outdated note in getting started guide

Description

According to the getting started guide, yew::Renderer::::with_props(..).render() is they way to mount your component, to an element that is not .
However, after some digging i figured out that the current way to do this is using yew::Renderer::::with_root(elem).render() instead.
I have changed the corresponding line in the getting started guide.

fixed outdated note in getting started guide
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 1d641e9):

https://yew-rs--pr3423-master-cgtql0v4.web.app

(expires Thu, 05 Oct 2023 21:30:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@@ -80,7 +80,7 @@ that updates its value when clicked. Replace the contents of `src/main.rs` with
:::note
The call to `yew::Renderer::<App>::new().render()` inside the `main` function starts your application and mounts
it to the page's `<body>` tag. If you would like to start your application with any dynamic
properties, you can instead use `yew::Renderer::<App>::with_props(..).render()`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original description is trying to say that with_props() can be used to set properties of App.

This should not be confused with with_root(), which can be used to set the root element where the renderer renders App into.

Copy link
Member

@futursolo futursolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible for you to update the tutorial to correctly reflect both methods?

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.

2 participants