File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1083,6 +1083,14 @@ async fn hydrate_flicker() {
10831083 // This components renders the same on the server and client during the first render,
10841084 // but then immediately changes the order of keyed elements in the next render.
10851085 // This should not lead to any hydration failures
1086+ #[ derive( Properties , PartialEq ) ]
1087+ struct InnerCompProps {
1088+ text : String ,
1089+ }
1090+ #[ component]
1091+ fn InnerComp ( InnerCompProps { text } : & InnerCompProps ) -> Html {
1092+ html ! { <p>{ text. clone( ) } </p> }
1093+ }
10861094 #[ component]
10871095 fn Flickering ( ) -> Html {
10881096 let trigger = use_state ( || false ) ;
@@ -1091,15 +1099,15 @@ async fn hydrate_flicker() {
10911099 trigger. set ( true ) ;
10921100 html ! {
10931101 <>
1094- <p key="1" > { "1" } </p >
1095- <p key="2" > { "2" } </p >
1102+ <InnerComp key="1" text= "1" / >
1103+ <InnerComp key="2" text= "2" / >
10961104 </>
10971105 }
10981106 } else {
10991107 html ! {
11001108 <>
1101- <p key="2" > { "2" } </p >
1102- <p key="1" > { "1" } </p >
1109+ <InnerComp key="2" text= "2" / >
1110+ <InnerComp key="1" text= "1" / >
11031111 </>
11041112 }
11051113 }
You can’t perform that action at this time.
0 commit comments