0

Foo is being displayed but not Bar. I am following a tutorial but using a different api but everything is the same, so I can't figure out why this isn't working.

import React, {Component} from 'react';
import ReactDOM from 'react-dom';

import movieDB from './themoviedb-javascript-library/themoviedb';

const movieList = () => {
return (
  <p>
  Bar
  </p>
);
}

class App extends Component {
constructor(props) {
super(props);
this.state = { movies: [] };

movieDB.search.getMovie({ "query":"Fight Club" }, (movies) => {
  // console.log(this)
  this.setState({movies: movies});
}, (err) => {
  console.log(err);
})
}

render() {
return (
  <div>
    Foo
    <movieList />
  </div>
)
}

}


ReactDOM.render(<App />, document.querySelector('.container'));
David
  • 944
  • 1
  • 13
  • 20

1 Answers1

2

React components have to be capitalized. MovieList should work. React treats lowercase tags as html tags and doesn't try to process them.

Jason Warta
  • 430
  • 5
  • 8