From 1fcc6d609f07c9f25d77c9c5e34631ff9a00ba97 Mon Sep 17 00:00:00 2001 From: Shivam Agarwal <99248722+shivamagarwal2510@users.noreply.github.com> Date: Tue, 31 Dec 2024 20:01:55 +0530 Subject: [PATCH] Update documentation based on recent code changes Appended E:\FinalAutoDoc\extractedRepos\shivamagarwal2510\react.devdocumentation\shivamagarwal2510/react.dev\src\content\warnings\unknown-prop.md Created shivamagarwal2510/react.dev/src/content/blog/[VERSION]-dom-nesting-changes.md --- .../blog/[VERSION]-dom-nesting-changes.md | 7 + src/content/warnings/unknown-prop.md | 153 +++++++++++------- 2 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 src/content/blog/[VERSION]-dom-nesting-changes.md diff --git a/src/content/blog/[VERSION]-dom-nesting-changes.md b/src/content/blog/[VERSION]-dom-nesting-changes.md new file mode 100644 index 00000000000..3e381cbf645 --- /dev/null +++ b/src/content/blog/[VERSION]-dom-nesting-changes.md @@ -0,0 +1,7 @@ +--- +title: DOM Nesting Validation Changes +--- + +### DOM Nesting Validation Changes + +- Added support for ` + /* ... */ + + + +``` + +--- + +If you get this warning because you pass props like `{...props}`, your parent component needs to "consume" any prop that is intended for the parent component and not intended for the child component. Example: + +**Bad:** Unexpected `layout` prop is forwarded to the `div` tag. + +```js +function MyDiv(props) { + if (props.layout === 'horizontal') { + // BAD! Because you know for sure "layout" is not a prop that