Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akxcv committed Feb 14, 2018
1 parent b60471c commit 30ab626
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 18 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased
## [0.2.1] - 2018-02-14
### Fixed
- Only pass wrapped children if children exist to pass prop type validation. (#27)
- Only pass wrapped children if children exist to pass prop type validation. (#27) - [@phillbaker][]

## [0.2.0] - 2017-11-10
### Updated
Expand All @@ -30,3 +30,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.1.0] - 2017-10-03
Initial release.

[@phillbaker]: https://github.com/phillbaker
15 changes: 10 additions & 5 deletions dist/vuera.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,15 @@ var makeReactContainer = function makeReactContainer(Component) {
value: function render() {
var _state = this.state,
children = _state.children,
rest = objectWithoutProperties(_state, ['children']);
_invoker = _state[''],
rest = objectWithoutProperties(_state, ['children', '']);

var wrappedChildren = this.wrapVueChildren(children);

return React.createElement(
Component,
rest,
React.createElement(VueContainer, { component: wrappedChildren })
children && React.createElement(VueContainer, { component: wrappedChildren })
);
}
}]);
Expand All @@ -346,8 +347,8 @@ var ReactWrapper = {
var _this2 = this;

var Component = makeReactContainer(component);
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, {
children: this.$slots.default,
var children = this.$slots.default !== undefined ? { children: this.$slots.default } : {};
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, children, {
ref: function ref(_ref) {
return _this2.reactComponentRef = _ref;
}
Expand All @@ -365,7 +366,11 @@ var ReactWrapper = {
* AFAIK, this is the only way to update children. It doesn't seem to be possible to watch
* `$slots` or `$children`.
*/
this.reactComponentRef.setState({ children: this.$slots.default });
if (this.$slots.default !== undefined) {
this.reactComponentRef.setState({ children: this.$slots.default });
} else {
this.reactComponentRef.setState({ children: null });
}
},

inheritAttrs: false,
Expand Down
15 changes: 10 additions & 5 deletions dist/vuera.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,15 @@ var makeReactContainer = function makeReactContainer(Component) {
value: function render() {
var _state = this.state,
children = _state.children,
rest = objectWithoutProperties(_state, ['children']);
_invoker = _state[''],
rest = objectWithoutProperties(_state, ['children', '']);

var wrappedChildren = this.wrapVueChildren(children);

return React.createElement(
Component,
rest,
React.createElement(VueContainer, { component: wrappedChildren })
children && React.createElement(VueContainer, { component: wrappedChildren })
);
}
}]);
Expand All @@ -340,8 +341,8 @@ var ReactWrapper = {
var _this2 = this;

var Component = makeReactContainer(component);
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, {
children: this.$slots.default,
var children = this.$slots.default !== undefined ? { children: this.$slots.default } : {};
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, children, {
ref: function ref(_ref) {
return _this2.reactComponentRef = _ref;
}
Expand All @@ -359,7 +360,11 @@ var ReactWrapper = {
* AFAIK, this is the only way to update children. It doesn't seem to be possible to watch
* `$slots` or `$children`.
*/
this.reactComponentRef.setState({ children: this.$slots.default });
if (this.$slots.default !== undefined) {
this.reactComponentRef.setState({ children: this.$slots.default });
} else {
this.reactComponentRef.setState({ children: null });
}
},

inheritAttrs: false,
Expand Down
15 changes: 10 additions & 5 deletions dist/vuera.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,15 @@ var makeReactContainer = function makeReactContainer(Component) {
value: function render() {
var _state = this.state,
children = _state.children,
rest = objectWithoutProperties(_state, ['children']);
_invoker = _state[''],
rest = objectWithoutProperties(_state, ['children', '']);

var wrappedChildren = this.wrapVueChildren(children);

return React.createElement(
Component,
rest,
React.createElement(VueContainer, { component: wrappedChildren })
children && React.createElement(VueContainer, { component: wrappedChildren })
);
}
}]);
Expand All @@ -343,8 +344,8 @@ var ReactWrapper = {
var _this2 = this;

var Component = makeReactContainer(component);
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, {
children: this.$slots.default,
var children = this.$slots.default !== undefined ? { children: this.$slots.default } : {};
ReactDOM.render(React.createElement(Component, _extends({}, this.$props.passedProps, this.$attrs, this.$listeners, children, {
ref: function ref(_ref) {
return _this2.reactComponentRef = _ref;
}
Expand All @@ -362,7 +363,11 @@ var ReactWrapper = {
* AFAIK, this is the only way to update children. It doesn't seem to be possible to watch
* `$slots` or `$children`.
*/
this.reactComponentRef.setState({ children: this.$slots.default });
if (this.$slots.default !== undefined) {
this.reactComponentRef.setState({ children: this.$slots.default });
} else {
this.reactComponentRef.setState({ children: null });
}
},

inheritAttrs: false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vuera",
"description": "Use React in Vue and Vue in React",
"version": "0.2.0",
"version": "0.2.1",
"repository": "akxcv/vuera",
"author": "Alexander Komarov <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 30ab626

Please sign in to comment.