Add failing end-to-end test for an action that returns client components #30550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This playwright test is using the Flight Fixture to demonstrate the Flight Reply equivalent of the scenario that was fixed in #30528 for the Flight Client.
It's basically an advanced case of what was outlined in #28564, returning a client component from a server action that is used in
useActionState
. In addition, the client component uses another element twice, which leads to the element's props being deduped. Resolving those references needs to be handled specifically, both in the Flight Client (done in #30528), as well as in the temporary references of the Flight Reply Client (and possibly Flight Reply Server?).The test should probably be converted into a unit test, e.g. in
packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js
orpackages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js
.