Skip to content

Update Error Boundary component children prop to accept ReactNode#156

Merged
MSNev merged 2 commits intomicrosoft:mainfrom
timagixe:error-boundary-component-restricts-children-to-reactelement-when-it-should-accept-reactnode
Apr 8, 2026
Merged

Update Error Boundary component children prop to accept ReactNode#156
MSNev merged 2 commits intomicrosoft:mainfrom
timagixe:error-boundary-component-restricts-children-to-reactelement-when-it-should-accept-reactnode

Conversation

@timagixe
Copy link
Copy Markdown
Contributor

Closes #155

@MSNev MSNev requested a review from Copilot March 31, 2025 16:50
Copy link
Copy Markdown

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 updates the AppInsightsErrorBoundary component by modifying the type of its children prop from React.ReactElement to React.ReactNode to support a wider variety of React elements.

  • Allow broader children types by changing the prop type
  • Enhance the flexibility of the Error Boundary component

@MSNev MSNev requested review from Karlie-777 and siyuniu-ms March 31, 2025 16:50
@timagixe
Copy link
Copy Markdown
Contributor Author

Hello, @Karlie-777 @siyuniu-ms have you been able to take a look at suggested changes within this PR?

@MSNev MSNev removed the request for review from siyuniu-ms May 13, 2025 15:58
@MSNev MSNev removed the request for review from Karlie-777 April 8, 2026 00:54
…to-reactelement-when-it-should-accept-reactnode
@MSNev
Copy link
Copy Markdown
Contributor

MSNev commented Apr 8, 2026

@timagixe Unfortunately, Karlie and Siyu are no longer on the team (for a while now), I'm currently working on an updated release to use the newly published v3.4.1 of Application Insights, and while I don't have the same range of knowledge on React that they had, I don't see anything wrong with this and therefore will push this in (assuming that all tests pass)

@MSNev MSNev merged commit 0b183b7 into microsoft:main Apr 8, 2026
6 checks passed
@MSNev MSNev added this to the 19.4.0 milestone Apr 8, 2026
@timagixe
Copy link
Copy Markdown
Contributor Author

timagixe commented Apr 9, 2026

@MSNev thanks for merging PR, I have just updated the packages to latest versions, removed fragment around children prop and it works like a charm. 👏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error Boundary Component Restricts Children to ReactElement When It Should Accept ReactNode

3 participants