Problem with 'video player' project - React

Hi, I’m in the React course, and I’m finishing the ‘video player’ project, but selecting the form options does not change the video. I have followed all the instructions and the video tutorial, but I don’t know where my mistake is. I leave you my code.

app.js

import React from 'react'; import ReactDOM from 'react-dom'; import { Video } from './Video'; import { Menu } from './Menu'; const VIDEOS = { fast: 'https://content.codecademy.com/courses/React/react_video-fast.mp4', slow: 'https://content.codecademy.com/courses/React/react_video-slow.mp4', cute: 'https://content.codecademy.com/courses/React/react_video-cute.mp4', eek: 'https://content.codecademy.com/courses/React/react_video-eek.mp4' }; class App extends React.Component { constructor(props) { super(props); this.state = { src: VIDEOS.fast }; this.chooseVideo = this.chooseVideo.bind(this); } chooseVideo(newVideo) { this.setState = ({ src: VIDEOS[newVideo] }); } render() { return ( <div> <h1>Video Player</h1> <Menu chooseVideo={this.chooseVideo}/> <Video src={this.state.src} /> </div> ); } } ReactDOM.render( <App />, document.getElementById('app') );

video.js

import React from 'react'; export class Video extends React.Component { render() { return ( <div> <video src={this.props.src} controls autostart autoPlay muted /> </div> ); } }

menu.js

import React from 'react'; export class Menu extends React.Component { constructor(props){ super(props); this.handleClick = this.handleClick.bind(this); } handleClick(e) { const text = e.target.value; this.props.chooseVideo(text); } render() { return ( <form onClick={this.handleClick}> <input type="radio" name="src" value="fast" /> fast <input type="radio" name="src" value="slow" /> slow <input type="radio" name="src" value="cute" /> cute <input type="radio" name="src" value="eek" /> eek </form> ); } }

Please, help me

Hi Juan,
welcome to the forums!

The state setter is a function that is called with the new state as an argument. You used it as if it were a variable and assigned a new state to it.

Check your function chooseVideo in App.js and review the use of setState from this lesson:
Update state with this.setState

Thanks, I found the error, I put an “=” in the setState.