fix(eagle): imply safeReactNode to exclude {} type from ReactNode#1307
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ReactNode variants
Member
Author
|
自测可见 storybook 中错误类型章节 |
chenenpei
reviewed
May 26, 2026
| </div> | ||
| )} | ||
| {renderContent()} | ||
| <> |
Member
Author
There was a problem hiding this comment.
因为 beforeContent 是一个 ReactNode,不加会出错,这个替换看起来传染性有点强
Member
Author
There was a problem hiding this comment.
我把因为 SmallDialog 的 prop 更新传染影响的 props 也修改了一下
Contributor
|
其他 LGTM。 |
…DeleteDialog props to eliminate type contagion
Member
|
顺便加个 lint 禁止使用 reactnode 类型吧 |
Member
Author
现在还不行,还没统一替换,具体的统一替换我觉得单独一个 mr 提出来比较好,上面也提到了,不同 props 替换的类型可能不一样,有些应该限制到 ReactElement 比较合适 |
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
introduce SafeReactNode type, exclude {} from native React.ReactNode which will make any object a legal input of props to avoid runtime crash.
Only replace SmallDialog component and related component, for other component, may use a stricter type like
React.ReactElement, here is an summary made by AI agent that recommend to replace ReactNode with ReactElementcore Directory
src/core/Tab/Tab.type.tsTabPropsextraSlotReactNodeReactElement | nullsrc/core/Select/select.widgets.tsxOptionPropsprefixReactNodeReactElement | nullsrc/core/Select/select.widgets.tsxOptionPropssuffixReactNodeReactElement | nullsrc/core/Alert/alert.type.tsAlertPropsactionReactNodeReactElement | nullsrc/core/message/message.tsxArgsPropsiconReactNodeReactElement | nullsrc/core/Nav/nav.type.tsNavPropsleftReactNode[]ReactElement[]src/core/Nav/nav.type.tsNavPropsrightReactNode[]ReactElement[]src/core/Nav/nav.type.tsNavPropscenterReactNode[]ReactElement[]src/core/TableForm/types.tsRowAddConfigurationsextraActionReactNodeReactElement | nullsrc/core/Metric/MetricActions.tsxMetricActionsdropdownReactNodeReactElement | nullsrc/core/Metric/RenderChart.tsxIChartPropsdropdownReactNodeReactElement | nullsrc/core/Overflow/index.tsxExtraOverflowextraEl(sliceEnd) => ReactNode(sliceEnd) => ReactElementsrc/core/Overflow/index.tsxExtraOverflowelsReactNode[]ReactElement[]src/core/LegacyModal/LegacyModal.type.tsLegacyModalPropscloseIconReactNodeReactElement | nullsrc/core/ImmersiveDialog/type.tsImmersiveDialogPropscloseIconReactNodeReactElement | nullsrc/core/ImmersiveDialog/type.tsImmersiveDialogPropsfooterLeftActionReactNodeReactElement | nullsrc/core/BaseIcon/index.tsxIBaseIconPropsprefixNodeReactNodeReactElement | nullsrc/core/Icon/index.tsxIconPropsprefixReactNodeReactElement | nullsrc/core/Timeline/Timeline.type.tsTimelineAreaPropssuffixReactNodeReactElement | nullsrc/core/Timeline/Timeline.type.tsTimelineItemDatainfoActionReactNodeReactElement | nullcoreX Directory
src/coreX/Dialogs/RejectDialog/RejectDialog.type.tsSingleRejectDialogPropsresourceIconReactNodeReactElement | nullsrc/coreX/Dialogs/RejectDialog/RejectDialog.type.tsMultiAllRejectDialogPropsresourceIconReactNodeReactElement | nullsrc/coreX/Dialogs/RejectDialog/RejectDialog.type.tsMultiPartialRejectDialogPropsresourceIconReactNodeReactElement | nullsrc/coreX/InfoRowList/InfoRowList.type.tsInfoListProps.dataactionReactNodeReactElement | null