DEV Community

Discussion on: Reason(React) Best Practices - Part 3

Collapse
 
idkjs profile image
Alain

Question:

When I through the alertType into an editor:

type alertType = [@bs.string] [
              | `default
              | [@bs.as "plain-text"] `plainText
              | [@bs.as "secure-text"] `secureText
              | [@bs.as "login-password"] `loginPassword
            ];
Enter fullscreen mode Exit fullscreen mode

I get bucklescript warnings on bs.string and bs.as.

alertType screenshot

Why is that?

Collapse
 
fhammerschmidt profile image
Florian Hammerschmidt

Hm, it's actually only for demonstration purposes. bs.string only works for arguments of functions. That's why it is inlined in the sources.