mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 14:40:44 +00:00
Clarify that expr in string literal limit of Rust
This commit is contained in:
parent
55b818b08d
commit
36ccb835ab
1 changed files with 1 additions and 1 deletions
|
@ -81,7 +81,7 @@ let name = "Bob";
|
||||||
rsx! ( "hello {name}" )
|
rsx! ( "hello {name}" )
|
||||||
```
|
```
|
||||||
|
|
||||||
Unfortunately, you cannot drop in arbitrary expressions directly into the string literal. In the cases where we need to compute a complex value, we'll want to use `format_args!` directly. Due to specifics of the `rsx!` macro (which we'll cover later), our call to `format_args` must be contained within square braces.
|
Unfortunately, you cannot yet drop in arbitrary expressions directly into the string literal with Rust. In the cases where we need to compute a complex value, we'll want to use `format_args!` directly. Due to specifics of the `rsx!` macro (which we'll cover later), our call to `format_args` must be contained within square braces.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
rsx!( [format_args!("Hello {}", if enabled { "Jack" } else { "Bob" } )] )
|
rsx!( [format_args!("Hello {}", if enabled { "Jack" } else { "Bob" } )] )
|
||||||
|
|
Loading…
Reference in a new issue