Why doesn't React props work?

  • 0
    When I put active and setActive on the front props do not work, and when I put active and setActive on the back they don’t work and props work.
    export const CardNews = ({ active, setActive }, props) => {
    
        return (
            <div className="news-card">
                <div className="news-card__content">
                    <div className="news-card__img">
                        <img src={image_1} alt="img" className="news-card__image" />
                    </div>
                    <div className="news-card__text">
                        <div className="news-card__title">{props.title}</div>
                        <div className="news-card__descr">{props.descr}</div>
                        <button className="check-news" id={props.id} onClick={() => setActive(true)}>
                            Читать
                        </button>
                    </div>
                </div>
            </div>
        )
    }
    React Wyatt Hampton, Apr 27, 2019

  • 1 Answers
  • 0
    ({active, setActive, ... props})
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!