Fix PathHoister attaching to default parameters. (#5415)

* Fix PathHoister attaching to default parameters.

Ref: #5315

* Update hoister.js
This commit is contained in:
Samuel Reed
2017-03-22 15:37:53 -05:00
committed by Henry Zhu
parent b2c977a1b0
commit f20da57317
7 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
function render(title= '') {
return () => (
<Component title={title} />
);
}

View File

@@ -0,0 +1,7 @@
function render() {
var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
var _ref = <Component title={title} />;
return () => _ref;
}

View File

@@ -0,0 +1,8 @@
{
"plugins": [
"transform-es2015-parameters",
"transform-react-constant-elements",
"transform-es2015-block-scoping",
"syntax-jsx"
]
}

View File

@@ -0,0 +1,5 @@
function render(Component, text = '') {
return function() {
return <Component text={text} />;
}
}

View File

@@ -0,0 +1,9 @@
function render(Component) {
var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var _ref = <Component text={text} />;
return function () {
return _ref;
};
}

View File

@@ -0,0 +1,8 @@
{
"plugins": [
"transform-es2015-parameters",
"transform-react-constant-elements",
"transform-es2015-block-scoping",
"syntax-jsx"
]
}