by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    matrixbot
    @matrixbot
    jplatte You have to remove .into() to fix that error, since Yew new does the same internally and double .into() is ambiguous in terms of which type the first .into() converts to
    Kelly Thomas Kline
    @kellytk
    Thank you!
    Dewyer
    @Dewyer
    Hello
    Whats up with yew-router ?
    Can't seem to build any of the examples
    If anyone can help, me I would greatly appriciate it :D
    I get : "the trait bound yew_router::router::Router<app::AppRoute>: yew::html::Component is not satisfied"
    if I try to do this in the html! macro: <Router<AppRoute> render = Router::render(|switch: AppRoute| { match switch { AppRoute::Register => html!{<p>{"Ola!"}</p>}, AppRoute::Index => html!{<p>{"asd"}</p>} } }) />
    Dewyer
    @Dewyer
    Sorry, solved it
    I had to bump and match some versions
    mb
    Rachel Powers
    @Ryex
    does anyone know why the yew RenderService and IntervalService don't seem to work?
    I register the callbacks but they never get called
    vietlib
    @vietlib
    Hi all is there any yew frontend real project demo please ?
    Dustin Bensing
    @pythoneer
    @vietlib you mean something like this? https://github.com/jetli/rust-yew-realworld-example-app
    madmaxio
    @madmaxio
    Ghost
    @ghost~57446ffdc43b8c601974aac9
    Hi, I enjoy coding with Yew (working on a live updating frontend for a web app with WebSockets, Warp, Yew and other cool stuff). I filed a question yewstack/yew#1255 which is blocking for me. Could somebody of you have a quick look? I guess it's a short answer.
    Faule Socke
    @faulesocke
    Hey there. How would I add a callback as a window event listener? There is of course window().add_event_listener_with_callback from web-sys but it does not accept a yew Callback directly, so I'm apparently missing some duct tape.
    Tigere Rangwani
    @Tig10
    Hi all, are the src/main.rs & src/lib.rs in todomvc example both generated by cargo new command?
    madmaxio
    @madmaxio
    No way.
    Tigere Rangwani
    @Tig10
    @madmaxio is your response in answer to my question? If so, let me rephrase it, if I create a new binary project with cargo new --lib todomvc & I now have asrc/lib.rs file, where is src/main.rs file coming from in todomvc example? see link in my previous post.
    Günter Zöchbauer
    @zoechi
    Hi all,
    I'm new to Yew.
    What is a good way to have attributes added to HTML elements if a value is actually passed in Props?
    To get
    <input  readonly="false">
    <input name="" tabindex="0" classname="-input" id="" readonly="false" type="">
    Günter Zöchbauer
    @zoechi
    from something like
        fn view(&self) -> Html {
            html! {
            <span /*className={classString} style={style}*/>
              <input
                  name={&self.props.name}
                  id={&self.props.id}
                  type={&self.props.type_}
                  required={self.props.required}
                  readOnly={self.props.read_only}
                  tabIndex={self.props.tab_index}
                  className={format!("{}-input", self.props.prefix_cls)}
                   checked={self.checked}
                  autofocus={self.props.auto_focus}
                  value={self.props.value}
              />
              <span className={format!("{}-inner", self.props.prefix_cls)} />
            </span>
                    }
        }
    Um, might be yewstack/yew#903
    madmaxio
    @madmaxio
    @Tig10 It is just created manually. When you will be doing your project just create a file for main component (application) module. You can call it whatever you like, app.rs for example. So it will lib.rs and app.rs (in case you are using wasm-bindgen based Yew).
    1 reply
    Günter Zöchbauer
    @zoechi

    There is also
    https://yew.rs/docs/concepts/components/properties#example

        /// The view function will not specify a size if this is None.
        #[prop_or_default]
        size: Option<u32>,

    but it's not clear what that relates to. The example does not contain a view function and I haven't seen a hint what size is used for.

    Günter Zöchbauer
    @zoechi
    Is there any way of adding attributes conditionally?
    Günter Zöchbauer
    @zoechi
    I found that I can create the view using VTag::new(...)yewstack/yew#1269
    Is there a way to add an event handler to such a tag?
    Is there a disadvantage of doing it this way compared to JSX except syntax convenience?
    matrixbot
    @matrixbot
    zoechi When I want to pass properties to the root component, how do I create an instance the props?
    Props::builder().build() does not work because there does not seem to be a build() method.
    I haven't figured out yet how the IDE would provide more information about what methods ::builder() has to offer.
    matrixbot
    @matrixbot
    zoechi Just Props{} lists all fields as missing even though all have prop_or or prop_or_default set
    Günter Zöchbauer
    @zoechi
    Props::builder().build() is working now. Seems to have been some Rust build issue.
    Philip Peterson
    @philip-peterson
    Anyone still hang out in the yew Gitter? Discord is quiet these days... 👀
    Justin Starry
    @jstarry
    @philip-peterson are you in the wrong Discord? there's been a fair amount of activity
    Philip Peterson
    @philip-peterson
    I would hope not! There’s just four channels, right? Last few days there has been some activity, maybe I am just used to more active projects, idk. Most of the PRs or issues I comment on are pretty silent and I don’t see much design discussion happening in the channels, maybe that’s why it feels different than the Gitter did a few months ago. Is Discord pretty much the only place things are discussed?
    Teymour Aldridge
    @teymour-aldridge
    There’s some discussion on Github Issues/PRs but other than that the only other avenue is Discord.
    Philip Peterson
    @philip-peterson
    Ok! Well, glad I checked anyway.
    Giacomo Cariello
    @giacomocariello
    Hi all
    Is there a way to interact with a yew App from an external javascript routine?
    madmaxio
    @madmaxio
    Sure, you need to use wasm-bindgen or stdweb (which is unsupported)
    Giacomo Cariello
    @giacomocariello
    I'm using wasm-bindgen. Let's say I have two yew apps loaded in different elements of the same DOM. How do I send messages from one to the other and vice-versa?
    Giacomo Cariello
    @giacomocariello
    I'm wondering whether I need to use event dispatching with a custom event or if there's another way I can follow.
    madmaxio
    @madmaxio
    Check agents functionality first, but because there will be (most likely) two separate events loops in you case agents might not work for you. In this case use some js variable for interaction.
    But the pattern itself is strange, try bring it two single app with separate components, if you can.
    Kelly Thomas Kline
    @kellytk
    @philip-peterson I am
    Kelly Thomas Kline
    @kellytk
    @teymour-aldridge yewstack/yew#1313 is nice thanks for it
    matrixbot
    @matrixbot
    jstarry FYI there's now a new matrix server which is connected to the Yew #development Discord channel here: https://matrix.to/#/!HvNEDXvXsveDVzOUNK:privacytools.io?via=privacytools.io&via=t2bot.io
    jstarry Thanks chrysn !
    Kelly Thomas Kline
    @kellytk
    How can Yew be used without wasm-pack?
    Kelly Thomas Kline
    @kellytk
    Regarding that doc article, it doesn't cover the .html file I assume is necessary. Is that intended?