Https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-react-part-ii/modules/fecp-advanced-react/projects/copycat

please i get stuck in this code apparently all the steps i do it very well but i didn’t know what the code don’t work well please help me and thanks an advance :

this i s the file of “CopyCat.js”:

import React from 'react';


const images = {
  copycat: 'https://content.codecademy.com/courses/React/react_photo_copycat.png',
  quietcat: 'https://content.codecademy.com/courses/React/react_photo_quietcat.png'
};


export class CopyCat extends React.Component {
    
  render() {
  
    
    return (
      <div>
        <h1>Copy Cat</h1>
        <img 
          alt='cat'
          src={this.props.copying ? images.copycat : images.quietcat}
          onClick={this.props.onClick}
        />
      </div>
    );
  };
}

and this is the file of “CopyCatContainer.js” :

import React from 'react';
import ReactDOM from 'react-dom';
import {CopyCat} from "CopyCat";

const images = {
  copycat: 'https://content.codecademy.com/courses/React/react_photo_copycat.png',
  quietcat: 'https://content.codecademy.com/courses/React/react_photo_quietcat.png'
};


class CopyCatContainer extends React.Component {
    constructor(props) {
    super(props);

    this.state = { 
      copying: true
    };

    this.toggleTape = this.toggleTape.bind(this);
  }

  toggleTape() {
    this.setState({copying: !this.state.copying})
  }
  
  render() {
    const copying = this.state.copying;
    const toggleTape = this.toggleTape
    
    return (
      <CopyCat copying={copying} onClick={this.props.toggleTape} />
    );
  };
}


ReactDOM.render(<CopyCatContainer />, document.getElementById('app'));

https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-react-part-ii/modules/fecp-advanced-react/projects/copycat

Your import in CopyCatContainer.js is wrong
It’s supposed to be:
import {CopyCat} from "../components/CopyCat";
instead of what you have, which is:
import {CopyCat} from "CopyCat";

1 Like

Thank you my friend for your help i found it last day

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.