-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
feat: back transition from validate to configure #2982
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
const [importStage, setImportStage] = useState<ImportStage>({ | ||
name: 'configure', | ||
}); | ||
const [importStage, setImportStage] = useState<ImportStage>('configure'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved state up to the parent to keep it for the entire flow
...configuration, | ||
}) | ||
tabs={ | ||
<ConfigurationTabs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a technique called "slots not props". Instead of prop drilling data I compose child components where the state is and pass them as ReactNodes.
environment: string; | ||
payload: string; | ||
} | ||
export const ConfigurationTabs: FC<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration stage exposes small components. They can be composed in the parent who owns the state
); | ||
|
||
export const ConfigurationStage: FC<{ | ||
tabs: ReactNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a typical signature for "slots not props" technique. ReactNode instead of lots of string fields
About the changes
Important files
Discussion points