Is conditional rendering possible?
I have the following code:
When accessing the page with an
Then the query resolved and now
Hitting a second time the same page with the same id will lead to a populated form: the cache is already present so this time
Is it possiple to trigger a re-rendering Γ la React - (don't shoot me
) - to rerun createForm with the actual data?
Or should I extract the
getProgram and postProgram are wrappers around solid-query.When accessing the page with an
id in the query string (eg. ?id=123) the first time, initialValues equals to undefined as the query is not yet finished and program.data is undefined.Then the query resolved and now
program.data is populated, but the form is already rendered so the form does not have any default values.Hitting a second time the same page with the same id will lead to a populated form: the cache is already present so this time
program.data is defined.Is it possiple to trigger a re-rendering Γ la React - (don't shoot me
Or should I extract the
createForm + <Form /> is a separate component and wrap it with a conditional <Show />?