Skip to content

I shouldn't have to prepend my eventnames with "top" #4206

Description

@namrog84
ConstantProviderDelegate SomeViewManager::ExportedCustomDirectEventTypeConstants() noexcept
{
    return [](winrt::Microsoft::ReactNative::IJSValueWriter const& constantWriter) {
        WriteCustomDirectEventTypeConstant(constantWriter, "Foo");
}
...
 ReactContext().DispatchEvent(someView, L"topFoo", args);

Most of our code is built around some constants in the class (e.g. SomeViewManager::Foo) instead of using literals everywhere.
Which means I need to do things like
winrt::to_hstring(std::string("top") + eventName);

It used to work without having to manually add "top", the internal DispatchEvent should handle these types of things or have appropriate functions to call like DispatchTopEvent

Even in the SampleApp
they are using "topLabelChanged" and "LabelChanged"

Also in places like this

https://github.com/react-native-community/react-native-video/blob/91384d848953d8c8b526a10f45d44f1bd38c62f0/windows/ReactNativeVideoCPP/ReactVideoView.cpp#L103
where Load, End, Seek, Progress were the registered names, but then someone had to fire "topLoad", "topEnd", "topSeek", and "topProgress"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions