You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 14, 2021. It is now read-only.
We need to introduce two new form components to our library, FormFileInput and ImageTransform.
FormFileInput will be our React abstraction for <input type="file" /> elements that allow users to select a file from their filesystem for submitting to our backend. Likewise, ImageTransform will be a component that allows an image supplied as a prop to be manipulated/cropped.
Both components should leave most of their interface abstract, making it the responsibility of the caller to handle state involving the files themselves. The caller will supply a callback method to be fired on the onChange event of FormFileInput so that the selected file can be stored in a stateful variable. This update to state can then be used to chain the file into ImageTransform where the cropped image can be stored in a second state variable that can be used when a custom onSubmit callback is fired.