-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
525: Breaking change: add support for required props r=jstarry a=jstarry #### Problem Before this change, properties must implement default which means that even if a prop always gets passed in by value to a component, it still needs a default state in props. No longer! #### Solution This breaking change allows annotating prop fields as required by using a procedural derive macro. #### Notes - If a prop is required, it does not need to implement `Default`. - If a prop is optional (not required), it must now implement `Default`. - If a required prop is not passed into a component, your app will not compile. - Props with lifetime parameters are not supported - Props with generics are supported! #### Breaking changes: 1. Properties must now implement the `Properties` trait by adding `#[derive(Properties)]` to their prop structs 2. Non-required prop fields must implement `Default` 3. Callback props created through the closure syntax will no longer return an `Option` type Depends on #518 Co-authored-by: Justin Starry <[email protected]>
- Loading branch information
Showing
33 changed files
with
1,009 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extern crate autocfg; | ||
|
||
pub fn main() { | ||
if autocfg::new().probe_rustc_version(1, 36) { | ||
println!("cargo:rustc-cfg=has_maybe_uninit"); | ||
} | ||
} |
Oops, something went wrong.