Skip to content
Snippets Groups Projects
Commit f2376c91 authored by Lutz Helm's avatar Lutz Helm Committed by Chris Beer
Browse files

Fix ProjectMirador/mirador-annotations#41 - make wrap plugin order stable

Array.prototype.reverse() changes the original array.
parent 4835e128
Branches
Tags
No related merge requests found
...@@ -43,7 +43,8 @@ function _withPlugins(targetName, TargetComponent) { // eslint-disable-line no-u ...@@ -43,7 +43,8 @@ function _withPlugins(targetName, TargetComponent) { // eslint-disable-line no-u
); );
}; };
return plugins.wrap.reverse().reduce(pluginWrapper, <TargetComponent {...passDownProps} />); return plugins.wrap.slice().reverse()
.reduce(pluginWrapper, <TargetComponent {...passDownProps} />);
} }
const whatever = React.forwardRef(PluginHoc); const whatever = React.forwardRef(PluginHoc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment