Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binding for name and displayName #433

Merged
merged 2 commits into from
Apr 27, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,10 @@ external useImperativeHandle7:

[@bs.set]
external setDisplayName: (component('props), string) => unit = "displayName";

[@bs.get]
external getName: component('props) => Js.undefined(string) = "name";

[@bs.get]
external getDisplayName: component('props) => Js.undefined(string) =
"displayName";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use [@bs.return nullable] on these - see #526 as an example to get a better api on the Reason side. Also I think we should make the API match and just call displayName and name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rickyvetter 🙌

[@bs.return nullable] is nice!