Open remitbri opened 2 weeks ago
When declaring a React component, unused but initialised parameters don't get the warning flag "unused variable xxx"
@react.component let make = ( ~unused1, // unused variable unused1. ~unsused2=true, ~unused3=?, // unused variable unused3. ~text=? ) => { <div> {React.string(text->Option.getOr(""))} </div> }
If it's a "regular" function, the same parameter gets the warning
let foo = ( ~unused1, // unused variable unused1. ~unsused2=true, // unused variable unsused2. ~unused3=?, // unused variable unused3. ~text=?) => text->Option.getOr("")
Using the playground, it seems the bug appeared with v10.1.2 and is still there for v11.x and v12.x
I believe this is because the JSX v4 emits a switch for the default param case, although not sure. cc @mununki
When declaring a React component, unused but initialised parameters don't get the warning flag "unused variable xxx"
If it's a "regular" function, the same parameter gets the warning
Using the playground, it seems the bug appeared with v10.1.2 and is still there for v11.x and v12.x