Fork me on GitHub
#other-languages
<
2017-11-15
>
borkdude12:11:25

Isn’t this problem with the spread operator not something that Rich also highlighted in his latest talk? https://jaredforsyth.com/2017/11/12/advanced-reasonreact-hider-order-components/ > Higher Order Components work in JavaScript because, in spreading the props to the child, you can “pass through” any props that the HOC doesn’t care about, but the child needs. OCaml’s type system doesn’t give us a good way to express “this component accepts any props the child does but also these other props”.

borkdude12:11:57

Btw, I have no idea what class FetcherComponent<T> means in JavaScript… Does it have static typing and generics now?

val_waeselynck12:11:29

@U04V15CAJ it doesn't, this might be Flow or Typescript

borkdude12:11:11

Maybe it’s something specific that React itself adds as a syntax?

val_waeselynck12:11:49

I don't think so, because Flow was developed at Facebook, no reason for them to have another gradual type system

borkdude13:11:52

JSX also has angly brackets 😉

val_waeselynck14:11:02

Yes, why miss an occasion to overload some syntax :)