Yes you are correct. If your logic is more complex then you will need to extract out the logic. Maybe some function or hook.

But there are ton's of cases where a particular fields visibility depends on a single variable (Example: forms for different users)

Then having this trick under the sleeve can help you.

Thank you for your response though :)

Software Engineer | https://www.mohammadfaisal.dev/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store