shadaj / slinky

Write Scala.js React apps just like you would in ES6
https://slinky.dev
MIT License
656 stars 57 forks source link

Support literal types in props #333

Open Katrix opened 4 years ago

Katrix commented 4 years ago

Currently when I try to define a prop type with literal types, I get a message like this? Using fallback derivation for type "auto" | Int | true (derivation: MacroWritersImpl). I'm assuming this means I might get surprising behavior at runtime. Would be neat if the macro could support literal types such as those.

shadaj commented 4 years ago

Fallback derivation for state types means that hot-reloading may run into trouble if the Scala.js representation of the underlying values is not stable. But the components should operate fine other than that.

We definitely should be able to support literal types though.