Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the Required utility type for a prop #415

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

nmanu1
Copy link
Contributor

@nmanu1 nmanu1 commented Oct 19, 2023

This PR adds support for the Required TypeScript utility type when defining the type of a prop in a component's prop interface. As mentioned in the previous PR, utility types are still not allowed when defining the overall type of the component's prop interface (i.e. props: Required<MyProps>).

J=SLAP-2969
TEST=auto, manual

In the test site, see that using Required<ObjectProp> instead of ObjectProp for the type of obj in BannerData correctly results in the prop editors for nestedString, nestedBool, and nestedObj no longer displaying the undefined menu button icon in the UI, while all other prop editors were unchanged.

@tmeyer2115 tmeyer2115 self-requested a review October 20, 2023 15:27
@nmanu1 nmanu1 merged commit 3e4f672 into main Oct 20, 2023
15 checks passed
@nmanu1 nmanu1 deleted the dev/required-utility branch October 20, 2023 15:32
@alextaing alextaing mentioned this pull request Oct 24, 2023
alextaing added a commit that referenced this pull request Oct 24, 2023
## Features
- We have introduced Collapsible Sidebars (#408).
- We now support aliased type imports (#411).
- The TypeScript utility types Omit, Pick, and Required are now
supported for props in a component's prop interface (#413, #414, #415).
- The Studio Preview can now display CSS and SCSS styling.
@alextaing alextaing mentioned this pull request Oct 30, 2023
alextaing added a commit that referenced this pull request Oct 30, 2023
## Features
- We have introduced Collapsible Sidebars (#408).
- We now support aliased type imports (#411).
- The TypeScript utility types Omit, Pick, and Required are now
supported for props in a component's prop interface (#413, #414, #415).
- The Studio Preview can now display CSS and SCSS styling (#418).
- Undo keyboard shortcuts (`cmd+z` for OS X, and `ctrl+z` for other
OSes) are now supported in Studio (#417).

## Changes
- `_server.tsx` and `_client.tsx` are now reserved template names for
PagesJS Repos (#423).

## Fixes
- Miscellaneous viewport bugs have been fixed (#424).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants