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

How to call a reusable function that uses yewdux store within use_effect hook?

I want to make a reusable function that uses yewdux store, and call it in use_effect of another component. As per hook rule, hooks can only be used in top level of a function / hook use crate::components::accounts::account_store::PhraseStore; use…
Amiya Behera
  • 2,210
  • 19
  • 32
0
votes
0 answers

How to perform asynchronous requests with Yew.rs?

I have an app component inside of a Yew project which is a Rust front-end framework. The syntax for fetching a GET request is still a bit of a mystery to me, for example, the rust-analyzer is complaining about books.clone();: struct BookList use…
Daniel
  • 14,004
  • 16
  • 96
  • 156
0
votes
0 answers

Attempting to create a new tauri app causes permissions error

I am new to working with tauri, and when I run cargo create-tauri-app it runs the 'setup' and askes for app name, package manager (cargo) and UI template. After choosing the final option, it says permission denied. I tried running the command with…
jason
  • 1,132
  • 14
  • 32
0
votes
1 answer

How to create a request and use the data from an async request?

I'm working on a function which makes a request to an API, pulls the data, and parses it before returning the data as a Vector of a particular type. Because this is part of a Yew project, tokio and other packages are incompatible. I'm using the…
Jackie
  • 198
  • 12
0
votes
1 answer

Yew Router doesn't match any routes

I'm attempting to build a SPA using Yew, and have followed this example. When I select links, the URL changes and the page renders correctly. (Yay!) But if I enter the URL, it returns 404. So for example, if I select the link for "History," the…
djmcmath
  • 97
  • 5
0
votes
1 answer

Cannot satisfy `'static` lifetime requirement

I am trying to create an app with yew. I have a list of players and i want to toggle their state from active to inactive but i struggle with object lifetime. rustc tells me that the self in my view function needs 'static lifetime requirement but i…
user2393256
  • 1,001
  • 1
  • 15
  • 26
0
votes
1 answer

How to render a font using Yew rust

I'm trying to make a website using Yew framework(?). I want to use a special font. I downloaded the font and I imported it into html, but Yew used server-side rendering and it doesn't allow me to just import a .ttf file as easily as a static page.…
LocalTrash
  • 19
  • 6
0
votes
0 answers

How can I use oauth2 response to make requests to the api guarded by it?

I am trying to use Authorization Code scheme with oauth2. How can I use the response from app backend to make new requests to the actual api (yahoo-fantasy) guarded by it? I have no idea how I can access the actual response on the code side, please…
Nae
  • 14,209
  • 7
  • 52
  • 79
0
votes
2 answers

How to connect favicon to a website in yew.rs?

I am creating a website through a framework "Yew.rs " and I can't connect favicon.ico. I tried to connect it with this method: but it doesn't work. Can you tell me how I can do…
Nick
  • 21
  • 5
0
votes
1 answer

could not find yew in stylist

I'm new to rust and yew and trying to use stylist crate with yew but when I try to import styled_components, I am getting following error. error[E0432]: unresolved import `stylist::yew` --> src\lib.rs:2:14 | 2 | use…
Harshal Limaye
  • 172
  • 1
  • 3
  • 9
0
votes
1 answer

How to listen to https endpoint with Yew & Trunk?

I am trying to develop a web app, for oauth2 debugging I am required to have the web app respond to https, how can this be done developing with Yew? Currently I am using: trunk serve --proxy-backend= In order to serve.
Nae
  • 14,209
  • 7
  • 52
  • 79
0
votes
1 answer

How do I fix material-yew use declaration?

I tried to do a hello world with material-yew. I tried to add this use declaration according to Material Yew's home page. use material_yew::MatButton; I've also tried this version that I've also seen in the docs: use…
kynnysmatto
  • 3,665
  • 23
  • 29
0
votes
0 answers

Error: error getting canonical path to source HTML file "index.html"

I am having the following error when I run trunk serve Error: error getting canonical path to source HTML file "index.html" Caused by: No such file or directory (os error 2)
Atif
  • 33
  • 2
0
votes
1 answer

How do I get an html page in synchronous code without using reqwest::blocking?

I need to make a function that will receive an HTML page from the link. Since I use the yew library, WASM does not allow me to use many custom libraries and functions. For example, the library Tokio, future and the function…
user15233994
0
votes
1 answer

Type mismatch in closure arguments + closure lifetimes

In Yew, I am attempting to bind a callback to the window resize event, triggering a Msg::Resize update. I have encountered: E0631 Type mismatch in closure arguments.` Expanded version of the code can be found…
James McGuigan
  • 7,542
  • 4
  • 26
  • 29
1 2 3
8 9