-
Notifications
You must be signed in to change notification settings - Fork 401
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
Refactor: dropzone context #355
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@4leite is attempting to deploy a commit to the Measured Team on Vercel. A member of the Team first needs to authorize it. |
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.
Thanks for putting this together! All seem like sensible refactors so I'm pretty happy for this to go in once the latest conflicts are resolved.
Yeah you had to go and do all that work on the dnd iframe compat! Got a bunch on and then it's Easter, so likely won't get back to this for a couple of weeks. |
Closing this until you're ready @4leite |
Use discriminated union type for DropZoneContext to provide a better typed context.
Facilitates the removal of a bunch of guard clauses and better documents the expected use.
Export DropZoneContext inside useDropZoneContext, useDropZoneEditContext and useDropZoneRenderContext.
Throw error on incorrect mode - we could add an ErrorBoundary to catch this, shouldn't be necessary due to:.
The current behaviour of gracefully showing a message on missing context is retained by moving it to the parent component.