I haven’t come across this error yet: This form is not allowed as the type of the inlined record could escape.
.
Here’s where I use the code:
@jsx.component
let make = (~data: data) => {
switch data->Plex.getFirstMovieFromMediaContainer {
| Some(Movie(movie)) => {
Console.log(movie) // <-- error is here
let {title} = movie
<Movie title />
}
| _ => <div> {Preact.string("Movie not found.")} </div>
}
}
And the type definition:
type media =
| @tag("type") @as("season") Season({parentTitle: string})
| @tag("type") @as("movie") Movie({title: string, thumb: string, ratingKey: int})