Skip to content

Instantly share code, notes, and snippets.

@stephen-james
Created October 31, 2018 13:57
Show Gist options
  • Save stephen-james/19be16bb1cf39accecb1e5801167839f to your computer and use it in GitHub Desktop.
Save stephen-james/19be16bb1cf39accecb1e5801167839f to your computer and use it in GitHub Desktop.
Unwrapping Mobx Injected components
const unWrapMobxInjectedComponent = <T extends {}>(component: IWrappedComponent<T>): T => {
let last: any = component;
while (component.wrappedComponent) {
last = component.wrappedComponent;
}
return last as T;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment