Next.js · Senior · Question 10 of 75
What is the React Taint API (experimental_taintObjectReference) for in Next.js?
- ✓Correct answer: To forbid passing a specific object to a client component
- 2To mark cached data as stale so it's reloaded from the server
- 3To encrypt cookie values before sending them to the user's browser
Explanation
For example, mark a user object from the DB: if it's passed whole into a client component's props, you get an error. It's a safety net, not the main protection - the foundation is a Data Access Layer that returns only the needed fields. It requires enabling taint in the config.