[Flight] Add Runtime Errors for Non-serializable Values (#19980)

* Error on encoding non-serializable props

* Add DEV time warnings to enforce that values are plain objects
This commit is contained in:
Sebastian Markbåge
2020-10-08 11:11:15 -07:00
committed by GitHub
parent 4c53d9f7f6
commit 58fb6b2f98
3 changed files with 368 additions and 6 deletions
+6 -1
View File
@@ -361,5 +361,10 @@
"370": "ReactDOM.createEventHandle: setter called with an invalid callback. The callback must be a function.",
"371": "Text string must be rendered within a <Text> component.\n\nText: %s",
"372": "Cannot call unstable_createEventHandle with \"%s\", as it is not an event known to React.",
"373": "This Hook is not supported in Server Components."
"373": "This Hook is not supported in Server Components.",
"374": "Event handlers cannot be passed to client component props. Remove %s from these props if possible: %s\nIf you need interactivity, consider converting part of this to a client component.",
"375": "Functions cannot be passed directly to client components because they're not serializable. Remove %s (%s) from this object, or avoid the entire object: %s",
"376": "Symbol values (%s) cannot be passed to client components. Remove %s from this object, or avoid the entire object: %s",
"377": "BigInt (%s) is not yet supported in client component props. Remove %s from this object or use a plain number instead: %s",
"378": "Type %s is not supported in client component props. Remove %s from this object, or avoid the entire object: %s"
}