так?
const ExpPanels = ({ handleExpansionChange, activePanel }) => {
return (
<Fragment>
{expTitles.map(({ value, title }) => (
<Fragment>
<Pnls
key={value}
panelClick={handleExpansionChange(value)}
title={title}
/>
<PanelsContent activeTxt={activePanel} activeId={value} />
</Fragment>
))}
</Fragment>
);
};
export default withExpPanels(ExpPanels);Ошибка:
Warning: Each child in an array or iterator should have a unique "key" prop.
Check the render method of ExpPanels. See https://fb.me/react-warning-keys for more information.
in Fragment (at ExpPanels.js:15)
in ExpPanels (at withExpPanels.js:18)
in EnhancedComponent (at Content.js:15)
in Content (at App.js:28)
in div (created by Context.Consumer)
in StyledComponent (created by styled.div)
in styled.div (at Tabs.js:19)
in Tabs (at App.js:16)
in App (at src/index.js:19)
in Provider (at src/index.js:18)
На Fragment надо ключ вешать
Обсуждают сегодня