<NME> Store.ts
<BEF> import * as _ from 'lodash';
import { ComponentProvider } from 'react-native';

export class Store {

  private propsById: Record<string, any> = {};

  setPropsForId(componentId: string, props: any) {
    _.set(this.propsById, componentId, props);
  }

  getPropsForId(componentId: string) {
    return _.get(this.propsById, componentId, {});
  }

  cleanId(componentId: string) {
    _.unset(this.propsById, componentId);
  }

  setComponentClassForName(componentName: string | number, ComponentClass: ComponentProvider) {
    _.set(this.componentsByName, componentName.toString(), ComponentClass);
  }

  getComponentClassForName(componentName: string | number): ComponentProvider | undefined {
    return _.get(this.componentsByName, componentName.toString());
  }
}
    if (this.pendingPropsById[componentId]) {
      this.propsById[componentId] = this.pendingPropsById[componentId];
      delete this.pendingPropsById[componentId];
    }
    return this.propsById[componentId] || {};
  }

  mergeNewPropsForId(componentId: string, newProps: any) {
    const currentProps = this.getPropsForId(componentId);
    this.propsById[componentId] = {
      ...currentProps,
      ...newProps,
    };
  }

  clearComponent(componentId: string) {
    delete this.propsById[componentId];
    delete this.componentsInstancesById[componentId];
  }

  setComponentClassForName(componentName: string | number, ComponentClass: ComponentProvider) {
    delete this.wrappedComponents[componentName];
    this.componentsByName[componentName.toString()] = ComponentClass;
  }

  getComponentClassForName(componentName: string | number): ComponentProvider | undefined {
    this.ensureClassForName(componentName);
    return this.componentsByName[componentName.toString()];
  }

  ensureClassForName(componentName: string | number): void {
    if (!this.componentsByName[componentName.toString()] && this.lazyRegistratorFn) {
      this.lazyRegistratorFn(componentName);
    }
  }

  setComponentInstance(id: string, component: IWrappedComponent): void {
    this.componentsInstancesById[id] = component;
  }

  getComponentInstance(id: string): IWrappedComponent | undefined {
    return this.componentsInstancesById[id];
  }

  setWrappedComponent(
    componentName: string | number,
    wrappedComponent: React.ComponentClass<any>
  ): void {
    this.wrappedComponents[componentName] = wrappedComponent;
  }

  hasRegisteredWrappedComponent(componentName: string | number): boolean {
    return componentName in this.wrappedComponents;
  }

  getWrappedComponent(componentName: string | number): React.ComponentClass<any> {
    return this.wrappedComponents[componentName];
  }

  setLazyComponentRegistrator(lazyRegistratorFn: (lazyComponentRequest: string | number) => void) {
    this.lazyRegistratorFn = lazyRegistratorFn;
  }
}

<MSG> Stop using lodash in store.js (#4729)

Using lodash.set caused issues when keys contained the dot symbol. _.set created objects inside the store, which is intended to be a simple key value dictionary -
In some cases, set would overwrite previously set values.
<DFF> @@ -1,4 +1,3 @@
-import * as _ from 'lodash';
 import { ComponentProvider } from 'react-native';
 
 export class Store {
@@ -6,22 +5,22 @@ export class Store {
   private propsById: Record<string, any> = {};
 
   setPropsForId(componentId: string, props: any) {
-    _.set(this.propsById, componentId, props);
+    this.propsById[componentId] = props;
   }
 
   getPropsForId(componentId: string) {
-    return _.get(this.propsById, componentId, {});
+    return this.propsById[componentId] || {};
   }
 
   cleanId(componentId: string) {
-    _.unset(this.propsById, componentId);
+    delete this.propsById[componentId];
   }
 
   setComponentClassForName(componentName: string | number, ComponentClass: ComponentProvider) {
-    _.set(this.componentsByName, componentName.toString(), ComponentClass);
+    this.componentsByName[componentName.toString()] = ComponentClass;
   }
 
   getComponentClassForName(componentName: string | number): ComponentProvider | undefined {
-    return _.get(this.componentsByName, componentName.toString());
+    return this.componentsByName[componentName.toString()];
   }
 }

{'addition_count': 5, 'commit_subject': 'Stop using lodash in store.js (#4729)', 'deletion_count': 6, 'file_extension': '.ts', 'lang': 'ts', 'license': 'mit', 'repo_name': 'wix/react-native-navigation'}