Skip to content

sendReact takes node not component#14292

Merged
JamieB-gu merged 1 commit intomainfrom
send-react-takes-node-not-component
Jul 29, 2025
Merged

sendReact takes node not component#14292
JamieB-gu merged 1 commit intomainfrom
send-react-takes-node-not-component

Conversation

@JamieB-gu
Copy link
Contributor

The current definition prevents any props being passed to the component.

Part of #13737.

The current definition prevents any props being passed to the component.
@JamieB-gu JamieB-gu requested a review from a team July 28, 2025 11:58
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@JamieB-gu JamieB-gu requested a review from Copilot July 28, 2025 11:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the sendReact function to accept a React node instead of a function component, enabling props to be passed to components. The change improves the flexibility of the development server by allowing components to receive props when rendered.

  • Modified sendReact function signature to accept ReactNode instead of FunctionComponent
  • Updated all router files to pass JSX elements instead of component references
  • Changed function syntax from arrow function to regular function declaration

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dotcom-rendering/src/devServer/send.tsx Updated function signature and implementation to accept ReactNode
dotcom-rendering/src/devServer/routers/targets.tsx Updated sendReact calls to pass JSX elements
dotcom-rendering/src/devServer/routers/pages.tsx Updated sendReact calls to pass JSX elements
dotcom-rendering/src/devServer/routers/liveApps.tsx Updated sendReact calls to pass JSX elements
dotcom-rendering/src/devServer/routers/editionsApp.tsx Updated sendReact calls to pass JSX elements
dotcom-rendering/src/devServer/routers/dotcom.tsx Updated sendReact calls to pass JSX elements
dotcom-rendering/src/devServer/routers/amp.tsx Updated sendReact calls to pass JSX elements

@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Jul 28, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jul 28, 2025
@JamieB-gu JamieB-gu merged commit 02f654d into main Jul 29, 2025
32 checks passed
@JamieB-gu JamieB-gu deleted the send-react-takes-node-not-component branch July 29, 2025 13:38
@prout-bot
Copy link

Seen on PROD (merged by @JamieB-gu 8 minutes and 53 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants