Questions tagged [yew]

Rust/Wasm framework for creating web applications

Yew takes inspiration from React and Redux. It uses Web Assembly and webworkers to create multi-threaded frontend apps.

The repository lives at https://github.com/yewstack/yew.

124 questions
0
votes
0 answers

Invalid route: insertion failed due to conflict with previously registered route: /_trunk/ws

hello I am experiencing this error when I try to execute trunk serve Invalid route: insertion failed due to conflict with previously registered route: /_trunk/ws. my trunk.toml file has the following contets: [build] target = "index.html" release =…
collinsmarra
  • 148
  • 1
  • 7
0
votes
1 answer

Pagination and REST API

This sounds like something very basic to implement but somehow I cannot figure it out. I'm building a website that shows some data on a page. Since there is a lot of data I want to display it in a paginated way. What I'm struggling with is the state…
Enigo
  • 3,685
  • 5
  • 29
  • 54
0
votes
0 answers

View lifecycle method in Yew Rust renders the first element repeatedly

I am making a web app using Yew Rust as front end. The structs User, Post, Vote are wrappers over JSON objects from the backend. I want to request several PostCards from the backend, format them using the html! macro and render them. The problem is…
radu781
  • 3
  • 2
0
votes
1 answer

How can I login with redirection (using POST)

I'm still trying to learn Rust and the YEW Framework (0.20). Following the YEW tutorial only teaches you to Get data, and many online examples are not working for my case. Is there a simple way to do this in YEW? What I'm trying to do is : Do a…
giri
  • 33
  • 7
0
votes
1 answer

Setup different environments to build a Yew app for staging, production, development

I have yew app that should connect to different backend APIs for development, staging and production. How can I set the build process up to build for these different environments?
grmmgrmm
  • 994
  • 10
  • 29
0
votes
0 answers

Convert web_sys::PostData to reqwest::multipart::Form

I have a form with a file input (filename): use yew::prelude::*; html! {
} I am…
Dric512
  • 3,525
  • 1
  • 20
  • 27
0
votes
0 answers

I wrote a table demo with rust yew, but got memory leak

use wasm_bindgen::prelude::*; use yew::prelude::*; #[wasm_bindgen] extern "C" { #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "tauri"])] async fn invoke(cmd: &str, args: JsValue) -> JsValue; #[wasm_bindgen(js_namespace =…
Chaos
  • 33
  • 5
0
votes
1 answer

Simple style! tag doesn't work in either Functional or Class Component in Yew.rs framework

This is a question related to the Rust reactive WASM framework. Here is the code (putting the style! component within the view function of the class component produces the same error). This example is taken from the example page here…
yosemeti
  • 206
  • 4
  • 15
0
votes
1 answer

Show input value in browser using Yew Rust

I am starting to learn Rust with Yew. I followed the counter example in the documentation and now I am trying to implement an input functionality. I want to show the input value in html. I am able to console.log it but not to render it in the…
programandoconro
  • 2,378
  • 2
  • 18
  • 33
0
votes
1 answer

Couldn't compile yew

I am using build a sample app from yew docs. I don't know why this app throw this error. this is yew version in Cargo.toml [dependencies] yew = { version = "0.20.0", features = ["csr"] } this is code in main.rs use…
Ganesh11
  • 129
  • 1
  • 6
0
votes
1 answer

Is it possible to create a multi-paged website using Github Pages and Yew?

I've just begun creating a portfolio website using Rust and Yew. I wasn't planning on doing any server-side logic so naturally I thought Github Pages fit my needs. Here is my code for the Yew site. #[derive(Debug, Clone, Copy, PartialEq,…
0
votes
2 answers

Create multiple html static files with Yew

Is it possible to create more than one HTML file (with relative JS & WASM modules) from a single Yew project. For example, here I create one artifact with the following: fn main() { yew::Renderer::::new().render(); } Is it possible to make…
Mattia Samiolo
  • 365
  • 2
  • 8
0
votes
0 answers

Make DOM load in web_sys

How would I modify this to get the result below? The thing is there is no iterable. I am not sure what I am doing at this point as this code was AI generated. But my desired result it the js code snippet below. use web_sys::{Element,…
collinsmarra
  • 148
  • 1
  • 7
0
votes
1 answer

How to return string value of state in hook?

Returning string state in use_effect_with_deps gives error. use std::ops::Deref; use yew::prelude::*; #[hook] pub fn use_hook_test() -> String { let first_load = use_state(|| true); let hash_state = use_state(|| "".to_owned()); let…
Amiya Behera
  • 2,210
  • 19
  • 32
1 2 3
8 9