mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Index UIManager.Commands correctly
Reviewed By: nicklockwood Differential Revision: D3275652 fb-gh-sync-id: a38e9cf6a46f2aa373b4948aa419b42af402c784 fbshipit-source-id: a38e9cf6a46f2aa373b4948aa419b42af402c784
This commit is contained in:
parent
54f7ae1c02
commit
d7de68241f
@ -102,10 +102,13 @@ if (Platform.OS === 'ios') {
|
||||
}
|
||||
commands = {};
|
||||
const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)];
|
||||
viewManager && Object.keys(viewManager).forEach((key, index) => {
|
||||
// Note: we depend on the fact that the JS object holding the configuration
|
||||
// retains key order. This will probably break at some point.
|
||||
let index = 0;
|
||||
viewManager && Object.keys(viewManager).forEach(key => {
|
||||
const value = viewManager[key];
|
||||
if (typeof value === 'function') {
|
||||
commands[key] = index;
|
||||
commands[key] = index++;
|
||||
}
|
||||
});
|
||||
return commands;
|
||||
|
Loading…
x
Reference in New Issue
Block a user