Reuse Create Form
I am trying to create a form component called
Possible problem: For the inputs that are not getting submitted, it might be because of the
What I tried: I tried to get the
Code for parent component is below, code for child(UserForm) is attached.
The fields that do not submit (but show up in form ui) are
Code for StudentCreate (Parent component that renders UserForm):
UserForm that's rendered by both StudentCreate and TeacherCreate components. Some input values are successfully submitted to the backend, but some inputs are not getting submitted. Possible problem: For the inputs that are not getting submitted, it might be because of the
control return prop from useForm. I am calling useForm from in both child and parent component, causing a disconnect. What I tried: I tried to get the
control prop in the parent component(StudentCreate) and then pass it down to the child component(UserForm) but control is supposed to be an instance of Control class and it's being passed as a regular pojo object, so I can't use the methods in control. So I'm not sure what to do next, really looking forward to your answer! Code for parent component is below, code for child(UserForm) is attached.
The fields that do not submit (but show up in form ui) are
classes, time_zone, class_format, start_date, and end_date Code for StudentCreate (Parent component that renders UserForm):
message.txt8.03KB
