mardi 30 octobre 2018

Warning: Each child in an array or iterator should have a unique "key" prop. React two button function conflict

React, I have two button function both of the button conflict. Please help me T_T

I got one error: Warning: Each child in an array or iterator should have a unique "key" prop.

import React, { Component } from 'react';
import Content from './HomeItem';
import { Container, Row } from 'reactstrap';

import 'bootstrap/dist/css/bootstrap.min.css';

const HomePage = props => {
  const tvshow = props.item;
  let res;

  if (tvshow.length > 0) {
    res = tvshow.map(res => (
      <Content item={res} onClick={props.onClick} onClick={props.onClick} />
    ));
  }

  return (
    <div>
      <Container>
        <Row>{res}</Row>
      </Container>
    </div>
  );
};

export default HomePage;




Aucun commentaire:

Enregistrer un commentaire