-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Unable to dispatch a custom event from Fabric components #34072
Comments
Seems like this is not implemented for TypeScript.
|
@andrestone I've tried to rewrite Codegen types to Flow and it didn't help either, so it doesn't seem like TypeScript is the issue here. Nonetheless, I was able to find a bit of free time today and "fix" this problem on my behalf. Strangely enough, using Feels super strange, so I'll probably keep this issue open. |
I think the way you've solved it is probably the "recommended" way. See this example. Writing the spec in flow (not in TS) also registers the view with the correct ViewConfig if you do this: // index.js
// ...
import { setRuntimeConfigProvider } from 'react-native/Libraries/NativeComponent/NativeComponentRegistry';
setRuntimeConfigProvider((name) => {
return name === 'MyView' ? { native: false, strict: false, verify: false } : null;
});
// ... |
cc @sammy-SC @cipolleschi is this related to Static View Config by any chance? |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Hey @justblender do you still experience this in 0.71? |
We can close this. I verified that events are properly dispatched with no ViewManager. The app must run on Bridgeless mode, of course. Screen.Recording.2024-01-24.at.16.09.20.mov |
Description
I've set up a custom Codegen component with a property of
onProgress
, which infersDirectEventHandler<Readonly<...>>
type.Codegen correctly identifies its type and generates an event emitter for this component, but dispatching it from Objective-C++ results in always receiving an
Unsupported top level event type topXYZ is dispatched
error.Version
0.69.0
Output of
npx react-native info
Steps to reproduce
onEventName
event handler prop.Snack, code example, screenshot, or link to a repository
TestComponent
withonProgress
event handler prop.TestComponentEventEmitter
class:onProgress
event:The text was updated successfully, but these errors were encountered: