mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
[GH-ISSUE #258] Event callbacks don't respect 'event' parameter #172
Labels
No labels
bug
documentation
enhancement
libui issue
pull-request
question
wait for libui implementation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/proton-native#172
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @apollolux on GitHub (Jan 28, 2020).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/258
Describe the bug
Events like Button.onPress can supposedly handle an
eventparameter (at least, that's what it looks like in their wrappers in the C++) but the actual passing of the event's data doesn't happen.To Reproduce
Set a Button's
onPressto a function with one parameter andconsole.logit. Observeundefinedis logged in its place.Expected behavior
I expected an object similar to a web Event to be logged.
Versions:
Additional context
I understand an Event is mainly a web construct, but there's no reason we can't copy its basics or use
nativeEventlike other RN components. For RN component events that don't take parameters (I'm looking at their list right now and quite a few components have event handlers that seem to be designed as zero-parameter callbacks, but it seems the docs are outdated???) I honestly recommend overloading them with one-parameter versions for this and don't know why upstream doesn't (or if they do why the docs haven't been updated to reflect this).I guess see react-native#27165 for something recent about it? It really feels like they dropped the ball regarding updating docs since a quick look through the current components' sources seem to indicate an
eventparameter on quite a few of their callbacks, usually extending from some implementation of SyntheticEvent (which seems to attempt to replicate web Event).@kusti8 commented on GitHub (Mar 16, 2020):
Interesting. I'll take a look later.