Copycat

The copycat project I am sharing please give me feedback name is Candy I am a little behind in this so will submitting a bunch thanks for all the help!!!

import React from ‘react’;

import ReactDOM from ‘react-dom’;

import {CopyCat} from ‘…/componentc/CopyCat’;

import {styles} from ‘…/styles’;

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() {

  const  {copying,toggletape,value,handlechange}=this.props}



return (

  < div style={styles.divStyle}>

    <h1 Style={{marginBottom:'80px'}}Copy Cat</h1>

    <imput 

    type = 'Text

    value = {value}

    onChange ={handleChange}

 />

  img

  alt='Cat'

  src={coping ? images.copycat:images.quietCat}

  style={styles.imgstyles}

  onclick={toggleTape}

  />

  <p>copying && value</p>

  </div>

);

};

}

CopyCat.proptypes = {

 copying: PropTypes.bool.isRequired,

 toggleTape: PropTypes.Func.isRequired,

 value: PropTypes.string.isRequired,

 handlechange: PropTypes.Func.isRequired

render()

const copying = this.state.copying;

const toggleTape = this toggleTape;

const value = this.state.input;

const hanldeChange = this.handleCharge;

}

return (

  <CopyCat

  copying={copying}

  ToggleTape={toggletape}

  value={value}

  handleChange=(handleChange)

  name={'Ben'}

  />

);

ReactDOM.render(, document.getElementById(‘app’));

Hi I’m actually doing the same project, I’m almost done.
But from what I can see you have quite a few typo mistakes that might lead to your code not working.
If its not working you might want to fix these typing mistakes :

render method corrected

const copying = this.state.copying;

const toggleTape = this.toggleTape;

const value = this.state.input;

const handleChange = this.handleChange;

PropTypes :

CopyCat.propTypes = {
  copying: PropTypes.bool.isRequired;
  toggleTape: PropTypes.func.isRequired;
  value: PropTypes.string.isRequired;
  handleChange: PropTypes.func.isRequired;
}

And also in your CopyCat component there some more type mistakes :

const  {copying, toggleTape, value, handleChange} = this.props}

Also its not <Imput …

Just try to always check those type mistakes speacially in a React environment where we’re using cameCase.

Hope this helps.
Happy Coding !

1 Like

thank you for thoughts I really appreciate that and will check smile here

1 Like

I finished my project, I also had a few syntax errors here and there but after going through each line of code countless times, I got it right. So if you need any help do not hesitate !
We’re here to help each other.

2 Likes

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