Exemplo n.º 1
0
        null,
      );
      return {namespace, ancestorInfo};
    }
    const parentNamespace = ((parentHostContext: any): HostContextProd);
    return getChildNamespace(parentNamespace, type);
  },

  getPublicInstance(instance) {
    return instance;
  },

  prepareForCommit(): void {
    eventsEnabled = ReactBrowserEventEmitter.isEnabled();
    selectionInformation = ReactInputSelection.getSelectionInformation();
    ReactBrowserEventEmitter.setEnabled(false);
  },

  resetAfterCommit(): void {
    ReactInputSelection.restoreSelection(selectionInformation);
    selectionInformation = null;
    ReactBrowserEventEmitter.setEnabled(eventsEnabled);
    eventsEnabled = null;
  },

  createInstance(
    type: string,
    props: Props,
    rootContainerInstance: Container,
    hostContext: HostContext,
    internalInstanceHandle: Object,
Exemplo n.º 2
0
 initialize: function() {
   var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
   ReactBrowserEventEmitter.setEnabled(false);
   return currentlyEnabled;
 },
Exemplo n.º 3
0
 close: function(previouslyEnabled) {
   ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
 },
Exemplo n.º 4
0
    parentHostContext : HostContext,
    type : string,
  ) : HostContext {
    if (__DEV__) {
      const parentHostContextDev = ((parentHostContext : any) : HostContextDev);
      const namespace = getChildNamespace(parentHostContextDev.namespace, type);
      const ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type, null);
      return {namespace, ancestorInfo};
    }
    const parentNamespace = ((parentHostContext : any) : HostContextProd);
    return getChildNamespace(parentNamespace, type);
  },

  prepareForCommit() : CommitInfo {
    const eventsEnabled = ReactBrowserEventEmitter.isEnabled();
    ReactBrowserEventEmitter.setEnabled(false);
    return {
      eventsEnabled,
      selectionInformation: ReactInputSelection.getSelectionInformation(),
    };
  },

  resetAfterCommit(commitInfo : CommitInfo) : void {
    ReactInputSelection.restoreSelection(commitInfo.selectionInformation);
    ReactBrowserEventEmitter.setEnabled(commitInfo.eventsEnabled);
  },

  createInstance(
    type : string,
    props : Props,
    rootContainerInstance : Container,