Skip to content

Unable to use #[cfg(target_os = "windows")] into a #[function_component] function #3049

Answered by hamza1311
ClementGre asked this question in Q&A
Discussion options

You must be logged in to vote

target_os checks the compilation target. The Yew app is compiled to WASM (wasm32-unknown-unknown). You'll have to use a Tauri API to check the current platform at runtime and act accordingly

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ClementGre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3046 on December 18, 2022 09:26.