Open Masa-Ryu opened 4 weeks ago
argument names are automatically renamed, some_arg
becomes someArg
and i guess some_
is a bit of undefined behavior but i would assume it gets converted to some
.
You can disable the renaming by changing #[tauri::command]
to #[tauri::command(rename_all = "snake_case")]
.
I will leave this issue open for now so the team can check how it's supposed to behave on arg names ending with an underscore.
I did not know that it was automatically converted. However, I too would like to know how it behaves when underscored.
Describe the bug
If an underscore is used in the variable name of the argument on the React side, the function on the Rust side will not be called and no error message will be displayed in dev mode.
Reproduction
App.tsx is here
main.rs is here
It is worth noting that when executing the Rust-side greets function in app.tsx, the argument msg_ is used as input. If the argument name contains underscores, the Rust-side greet function will not be executed. This is the bug.
Expected behavior
It works even if underscores are included.
Full
tauri info
outputStack trace
No response
Additional context
No response