Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authenticityToken prop is passed down components too much #165

Open
riggraz opened this issue Oct 24, 2022 · 0 comments
Open

authenticityToken prop is passed down components too much #165

riggraz opened this issue Oct 24, 2022 · 0 comments
Labels
javascript Issues that require javascript knowledge and pull requests that update Javascript code refactoring Refactoring, cleanups, technical debt reduction

Comments

@riggraz
Copy link
Collaborator

riggraz commented Oct 24, 2022

The authenticityToken must be sent to the backend in order to submit content. The problem is that, in many cases, this prop must be passed down the React components tree and is used just once, cluttering the code with it.

A solution to avoid passing it down component by component is to use React context (https://reactjs.org/docs/context.html)

@riggraz riggraz added javascript Issues that require javascript knowledge and pull requests that update Javascript code refactoring Refactoring, cleanups, technical debt reduction labels Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Issues that require javascript knowledge and pull requests that update Javascript code refactoring Refactoring, cleanups, technical debt reduction
Projects
None yet
Development

No branches or pull requests

1 participant