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
1
vote
2 answers

rust yew app working on local laptop/pc not behind nginx

This is prob very easy to solve(I hope) I never deployed wasm apps before and now I have a working frontend(rust yew) and backend(actix) working locally on my laptop and PC when I run it without nginx, just raw dev. Problem comes when I…
rek2
  • 101
  • 12
1
vote
0 answers

rust yew with wasm issue at deployment

This the first time deploying a wasm web app, I have deployed many go, php, python, perl, web apps before on nginx, apache etc. This is all working fine as dev on my PC and my Laptop. -I am using rust yew and on the server steps: I git clone on…
cfernandezlinux
  • 861
  • 1
  • 10
  • 23
1
vote
0 answers

In Yew, how is it possible to locate index.html in a static/ directory?

I have something going wrong with my Yew App. I try to locate index.html inside the static/ and, I have this in my Trunk.toml file: [build] target = "./static/index.html" And ultimately, my app compiles with a warning which is "no rust project…
1
vote
1 answer

What steps does a Github Action Script for deploying Yew Apps with Trunk to Firebase has to have?

The issue I was facing, was that I had a hard time figuring out how to set up the correct deploy script for the Firebase Github action yml file.
Samulsen
  • 41
  • 5
1
vote
0 answers

Rust Yew.rs dropdown component

I have some code for dropdown link. It works fine, but I'd like this code to work as usual. When we click somewhere outside or click the link inside, dropdown should be closed. How to implement this thing? If I don't want use Bootstrap js but only…
1
vote
0 answers

Unable to run yew's documentation sample

I am trying to build the sample app from the yew documentation (here) and I am getting the error below. If feels that it's something wrong with my environment since there are only 3 files to change for the app. Any input is…
T. Francis
  • 169
  • 1
  • 12
1
vote
1 answer

onmousemove event results in wrong position

I am trying to move an element in the screen using Yew. When element is in the top left of the screen, I can move it correctly. But when the element starts in other position, it gets to a wrong place when trying to move it. It seems that the…
programandoconro
  • 2,378
  • 2
  • 18
  • 33
1
vote
0 answers

Trunk build fails for the simplest example

I am trying to learn to use Trunk and Yew so I tried to follow a very simple example of Trunk, created a neatly empty index.html in the root of my rust project (just the main tags and made trunk build the thing fails with: trunk …
user23415
1
vote
2 answers

cannot find function `start_app` in crate `yew`

I'm trying to write a simple Rust web programming with Yew, this is main.rs source code : use lat12::App; fn main() { yew::start_app::(); } and this is a simple library : use yew::prelude::*; #[function_component(App)] pub fn app() ->…
Darlina
  • 101
  • 1
  • 10
1
vote
1 answer

How to get the value from state in Yew Rust

I have a state in Yew that looks like this: let is_flipped: UseStateHandle = use_state(|| false); As you can see, its type is UseStateHandle. I want to extract its boolean value so I can toggle the state: let onclick:…
programandoconro
  • 2,378
  • 2
  • 18
  • 33
1
vote
1 answer

tag and CSS - How to stop overflow by scaling the image down to the available height

I have been trying to make an image viewer component in Yew + tauri. I am using tailwindcss for my css. I have a column flexbox: #[function_component] pub fn ImageViewer() -> Html { html!(
ShinyDemon
  • 33
  • 5
1
vote
1 answer

How to control Yew route from external JS in SPA?

I am trying to use Yew in an SPA alongside some external Javascript. I'm looking for the right way to enable the external Javascript code to change the current route in my Yew application without causing a network reload. I have experimented with…
jq170727
  • 13,159
  • 3
  • 46
  • 56
1
vote
0 answers

How to create a generic type function to fetch data from an API in Rust?

I would like to fetch data from a backend API in my Yew based on a certain datatype, that is my model. I have managed to do the job based on a tutorial on yew.rs: https://yew.rs/docs/tutorial After that I wanted to create a generic type function to…
1
vote
1 answer

What is the Equivalent of alert() (javascript) in Yew (A framework in rust)?

I am not sure of what is the equivalent of alert(), in Yew. Please tell me what is the equivalent of alert().
CatWayRoad
  • 35
  • 5
1
vote
2 answers

How to use a Future as yew::callback::Callback

I have following callback which I'm registering to onsubmit event. use gloo::net::http::Request; use yew::prelude::*; let on_submit = Callback::from(async move |ev: FocusEvent| { ev.prevent_default(); let res =…
s1n7ax
  • 2,750
  • 6
  • 24
  • 53
1 2
3
8 9