rescript-react-native / rescript-react-native.github.io

Official Website
https://rescript-react-native.github.io
MIT License
12 stars 12 forks source link

Document `_` prefixed props (eg: _ItemSeparatorComponent) or change this #5

Open MoOx opened 5 years ago

MoOx commented 5 years ago

Coming from JS, this can be disturbing. You could think it's unused, since _ are often unused to avoid non usage warning.

We could also try to remove them & use lowercase.

Thoughts @cknitt @sgny ?

cknitt commented 5 years ago

AFAIK the _ props are the only way this works with @bs.obj and thereby @react.component - @bs.as is not supported here.

sgny commented 5 years ago

It appears we responded at the same time.

This is already addressed in BuckleScript documentation however, we might as well add a reference to that. The leading _ is ignored when an uppercase letter follows and I understand some of these props are supposed to begin with an uppercase letter. I don't understand the design decision that makes these props so particularly special that they could not have been in lowercase, but that's a different kettle of fish.

To be honest, coming from JavaScript nothing should be too weird 😁.