Skip to content

Commit

Permalink
[fix] top-level API exports
Browse files Browse the repository at this point in the history
Also fixes importing these APIs from 'react-native' when used with the
Babel plugin.
  • Loading branch information
necolas committed Dec 18, 2017
1 parent f1ce6c2 commit 9bcc67e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/apis/AppRegistry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import invariant from 'fbjs/lib/invariant';
import { unmountComponentAtNode } from 'react-dom';
import { unmountComponentAtNode } from '../../modules/unmountComponentAtNode';
import renderApplication, { getApplication } from './renderApplication';
import type { ComponentType } from 'react';

Expand Down
5 changes: 2 additions & 3 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import createElement from './modules/createElement';
import findNodeHandle from './modules/findNodeHandle';
import NativeModules from './modules/NativeModules';
import processColor from './modules/processColor';
import { hydrate, render, unmountComponentAtNode } from 'react-dom';
import render from './modules/render';
import unmountComponentAtNode from './modules/unmountComponentAtNode';

// APIs
import Animated from './apis/Animated';
Expand Down Expand Up @@ -63,7 +64,6 @@ import ViewPropTypes from './components/View/ViewPropTypes';
export {
// top-level API
findNodeHandle,
hydrate,
render,
unmountComponentAtNode,
// modules
Expand Down Expand Up @@ -128,7 +128,6 @@ export {
const ReactNative = {
// top-level API
findNodeHandle,
hydrate,
render,
unmountComponentAtNode,

Expand Down
12 changes: 12 additions & 0 deletions src/modules/render/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { render } from 'react-dom';
export default render;
12 changes: 12 additions & 0 deletions src/modules/unmountComponentAtNode/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2016-present, Nicolas Gallagher.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
*/

import { unmountComponentAtNode } from 'react-dom';
export default unmountComponentAtNode;

0 comments on commit 9bcc67e

Please sign in to comment.