Form to capture the data needed to create a plant in the db
Spent some time thinking of the best way to create the form and whether to create the form and then manage data input and state etc. Started off using FormData but found it not to work so well for radio and checkbox inputs. After a bit of research I chose React Hook Form which creates an object from all the data inputed.
Screenshots below show the data as entered in the form and the console log of that data.
Other commits
updated model to use camelCase
installed prop-types to validate props in React
Next steps
add one more field to the form to collect the temperature input
add form validation to fields
review form fields to ensure they are accessible
look at Cloudinary to store the uploaded image and return the URL that can get saved in the db
use the fetch() method to send the object to the db
Will update form styling etc further down the line.
Form to capture the data needed to create a plant in the db
Spent some time thinking of the best way to create the form and whether to create the form and then manage data input and state etc. Started off using FormData but found it not to work so well for radio and checkbox inputs. After a bit of research I chose React Hook Form which creates an object from all the data inputed.
Screenshots below show the data as entered in the form and the console log of that data.
Other commits
prop-types
to validate props in ReactNext steps
fetch()
method to send the object to the dbWill update form styling etc further down the line.