Skip to content

Fix Segment children prop-types warning for the Toolbar portal (#97) - #98

Merged
reekitconcept merged 1 commit into
feature-ai-ragfrom
kid/fix-toolbar-portal-segment
Jul 29, 2026
Merged

Fix Segment children prop-types warning for the Toolbar portal (#97)#98
reekitconcept merged 1 commit into
feature-ai-ragfrom
kid/fix-toolbar-portal-segment

Conversation

@reekitconcept

Copy link
Copy Markdown
Member

Fixes the React warning Invalid prop children supplied to Segment, expected a ReactNode on client-side navigation to the search page (#97).

createPortal returns a ReactPortal — renderable, but not recognized by the prop-types node checker, so Segment's propTypes flagged it. The portal now renders as a sibling of the Segment inside a fragment; behavior is unchanged (a portal renders into its DOM target regardless of tree position, and Segment provides no context or handlers the subtree would lose).

The bulk of the diff is prettier reindentation from the fragment wrapper — review with git diff -w (7 insertions, 1 deletion).

Same fix goes to main in a separate PR; kitconcept.intranet's SolrSearch override carries a copy of this pattern and gets the same fix there.

Client-side navigation to the search page warned 'Invalid prop
children supplied to Segment, expected a ReactNode': createPortal
returns a ReactPortal, which renders fine but is not recognized by the
prop-types node checker. Render the portal as a sibling of the Segment
(a portal renders into its DOM target regardless of tree position;
Segment provides no context or handlers the subtree would lose).

The indentation-only changes are prettier reindent after wrapping in a
fragment - review with 'git diff -w' (7 insertions, 1 deletion).
@reekitconcept
reekitconcept merged commit 397e09b into feature-ai-rag Jul 29, 2026
17 checks passed
@reekitconcept
reekitconcept deleted the kid/fix-toolbar-portal-segment branch July 29, 2026 15:33
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.

1 participant