Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

This form is not allowed as the type of the inlined record could escape

$
0
0

You defined an inline record inside of a variant, so you can’t create a variable of this inline type, you have to pattern match on its fields to to access them, like this:

@jsx.component
let make = (~data: data) => {
  switch data->Plex.getFirstMovieFromMediaContainer {
  | Some(Movie({title, thumb, ratingKey})) => {
      Console.log3(title, thumb, ratingKey)  // <-- works now
      <Movie title />
    }
  | _ => <div> {Preact.string("Movie not found.")} </div>
  }
}

Viewing all articles
Browse latest Browse all 2592

Trending Articles