Skip to content

Commit

Permalink
fix: Added keys to fragments and other helper components
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zurg committed Jun 23, 2020
1 parent 3885375 commit 3ae06f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/components/Resizer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ export const Resizer = ({
) : null;

return (
<div style={{ position: 'relative' }}>
<div key="grabber.root" style={{ position: 'relative' }}>
<ResizeGrabber
key="grabber"
$isVertical={isVertical}
$isCollapsed={isCollapsed}
style={getWidthOrHeight(grabberSize)}
Expand All @@ -136,10 +137,10 @@ export const Resizer = ({
>
{collapseButton}
</ResizeGrabber>
<Fade in={!isHovered}>
<Fade key="resize.presentation.fadein" in={!isHovered}>
<ResizePresentation $isVertical={isVertical} style={{ ...getWidthOrHeight(1), ...css }} />
</Fade>
<Fade in={isHovered}>
<Fade key="resize.presentation.fadeout" in={isHovered}>
<ResizePresentation
$isVertical={isVertical}
style={{ ...getWidthOrHeight(1), ...hoverCss }}
Expand Down
5 changes: 3 additions & 2 deletions src/components/SplitPane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const SplitPane = ({ className = '', ...props }: SplitPaneProps) => {
const entries = childPanes.map((pane, paneIndex) => {
const resizerPaneIndex = isCollapseReversed ? paneIndex : paneIndex - 1;
return (
<>
<React.Fragment key={paneIndex}>
{paneIndex - 1 >= 0 ? (
<Resizer
key={`resizer.${resizerPaneIndex}`}
Expand Down Expand Up @@ -113,7 +113,7 @@ export const SplitPane = ({ className = '', ...props }: SplitPaneProps) => {
>
{pane.node}
</Pane>
</>
</React.Fragment>
);
});

Expand All @@ -124,3 +124,4 @@ export const SplitPane = ({ className = '', ...props }: SplitPaneProps) => {
);
};
SplitPane.displayName = 'SplitPane';
SplitPane.key = 'SplitPane';

0 comments on commit 3ae06f0

Please sign in to comment.