Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed prop type: Invalid prop `responsive` of type `string` supplied to `Image`, expected `boolean`

Line in question:

<Poster 
  info="info" 
  id={movie.id} 
  path={movie.poster_path} 
  title={movie.title} 
  popularity={movie.popularity} 
  genres={genres} 
  responsive="responsive"
/>

Should be really simple i just cant work out how to change responsive="responsive" into the right boolean what is it expecting?

Thanks

like image 828
Max Silva Avatar asked Dec 24 '22 03:12

Max Silva


1 Answers

The component Poster expects responsive prop to be a boolean and not a string. A boolean true value can simply be passed like

<Poster 
    info="info"
    id={movie.id}
    path={movie.poster_path}
    title={movie.title} popularity={movie.popularity}
    genres={genres}
    responsive
/>

or

    <Poster 
    info="info"
    id={movie.id}
    path={movie.poster_path}
    title={movie.title} popularity={movie.popularity}
    genres={genres}
    responsive={true}
/>

and a false value can be given like

<Poster 
    info="info"
    id={movie.id}
    path={movie.poster_path}
    title={movie.title} popularity={movie.popularity}
    genres={genres}
    responsive={false}
/>
like image 195
Shubham Khatri Avatar answered Jan 19 '23 00:01

Shubham Khatri