Handle and parse Django REST Framework validation messages with aplomb.
npm i django-exceptions --save
Getting Started
Django Exceptions will attempt to flatten the validation messages into a single hierarchy, as otherwise the validation messages are infinitely nested, which makes it troublesome to render to HTML. Thus you are guanrateed to have a single array of all validation messages, with a field
and messages
key – both of which themselves are arrays.
; const data = await ; ;
In React you might do something like the following to render the messages:
; { return <ul className="messages"> </ul> ; }