[Beginner] makeProps interop

reasonreact

#1

Hello @everyone,

I’ve stuck with interop component from existing component in JS.

[@bs.deriving jsConverter]
type colors = 
 | [@bs.as "white"] `White
 | [@bs.as "black"] `Black

module View = {
 type props = {
  .
  "bg": option(string),
 };
 let makeProps = (~bg=?, ()) => { "bg": bg->colorToJs}
 [@bs.module "ui-component"]
 external make = React.component(props) = "View";
}

I don’t know how to handle bg as option type of props.

thanks