mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-26 04:26:43 +08:00
fix: fix dispatching compat actions
This commit is contained in:
@@ -27,9 +27,9 @@ export default function createCompatNavigationProp<
|
||||
return {
|
||||
...navigation,
|
||||
...Object.entries(helpers).reduce<{ [key: string]: Function }>(
|
||||
(acc, [name, method]) => {
|
||||
(acc, [name, method]: [string, Function]) => {
|
||||
if (name in navigation) {
|
||||
acc[name] = method;
|
||||
acc[name] = (...args: any[]) => navigation.dispatch(method(...args));
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user