microsoft / microsoft/react-native-windows
Dispatching an event with arg value 0 wrongly becomes {}
Open
@vmoroz is already working on this.
Since Jul 12, 2021.
Area: Native Modules
bug
Workstream: Module Support
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
int64_t result = foo();
XamlUIService::FromContext(context).DispatchEvent(cd, L"topContentDialogClosed",
[result](const winrt::Microsoft::ReactNative::IJSValueWriter& evtDataWriter) {
evtDataWriter.WriteInt64(result);
});
if result is any non-zero number, this works fine. However if it is zero, then the value of the nativeEvent on the JS side becomes {} i.e. something is converting this to an empty object instead of keeping it as an int as it is intended
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.