In Laravel Blade, we access the CSRF field by putting @CSRF within a form. What I would like to do is to access the CSRF field in React JSX instead of Blade. I found an answer here React js - Laravel 5: Using csrf-token in POST method but I would like to know if there's a better way to do this.
How can I put a CSRF field in a form in (React) JSX in the best possible way?
api.phpit req. token and not req. csrf token