Skip to content

Commit

Permalink
fix(types): fix TreeLabelInteractable to allow children (uber#5183)
Browse files Browse the repository at this point in the history
Co-authored-by: Chase Starr <[email protected]>
  • Loading branch information
alexgorbatchev and chasestarr authored Oct 4, 2022
1 parent bdf5270 commit fb9aff2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/tree-view/tree-label-interactable.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import type { OverrideT } from '../helpers/overrides.js';

const TreeLabelInteractable: React$ComponentType<{
overrides?: { LabelInteractable: OverrideT },
/** Content to be rendered in the TreeLabelInteractable. */
children?: React$Node,
}> = ({ overrides = {}, ...props }) => {
const LabelInteractable = getOverride(overrides.LabelInteractable) || StyledLabelInteractable;
return (
Expand Down
14 changes: 8 additions & 6 deletions src/tree-view/tree-label-interactable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import { StyledLabelInteractable } from './styled-components';
import { getOverride } from '../helpers/overrides';
import type { Override } from '../helpers/overrides';

import type { ComponentType } from 'react';
import type { ComponentType, PropsWithChildren } from 'react';

const TreeLabelInteractable: ComponentType<{
overrides?: {
LabelInteractable: Override;
};
}> = ({ overrides = {}, ...props }) => {
const TreeLabelInteractable: PropsWithChildren<
ComponentType<{
overrides?: {
LabelInteractable: Override;
};
}>
> = ({ overrides = {}, ...props }) => {
const LabelInteractable = getOverride(overrides.LabelInteractable) || StyledLabelInteractable;
return (
// $FlowExpectedError[cannot-spread-inexact]
Expand Down

0 comments on commit fb9aff2

Please sign in to comment.