-
Hello, im new using django-bridge and im trying to render a django form in a react component, but i want to define custom tailwind class for each field, but i don't understand how to do it. Some help about should be gracefully!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Form rendering is currently handled in the project itself (rather than within django-bridge). In the project template, there is this class which represents Django forms in the frontend and provides a You can customise this code to render the form and its fields how you like. The widgets themselves usually have their own separate classes which you can customise. In the project template, these are located in the |
Beta Was this translation helpful? Give feedback.
Form rendering is currently handled in the project itself (rather than within django-bridge).
In the project template, there is this class which represents Django forms in the frontend and provides a
.render()
method: https://github.com/django-bridge/create-django-bridge/blob/6d476fed83ab1bdc82346914ce897c21befa9313/template/client/src/adapters/Form.tsx#L27You can customise this code to render the form and its fields how you like. The widgets themselves usually have their own separate classes which you can customise. In the project template, these are located in the
client/src/adapters/
folder.