Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions blaze-react-component/.versions
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
babel-compiler@7.5.0
babel-compiler@7.9.0
babel-runtime@1.5.0
base64@1.0.12
blaze@2.1.5
blaze-tools@1.0.10
caching-compiler@1.2.1
caching-compiler@1.2.2
caching-html-compiler@1.0.4
check@1.3.1
deps@1.0.12
diff-sequence@1.1.1
dynamic-import@0.5.1
ecmascript@0.14.0
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.10.0
ecmascript-runtime-server@0.9.0
ejson@1.1.1
dynamic-import@0.7.2
ecmascript@0.16.2
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.2
fetch@0.1.1
gadicc:blaze-react-component@1.4.3
hexsprite:blaze-react-component@1.4.4
html-tools@1.0.11
htmljs@1.0.11
id-map@1.1.0
inter-process-messaging@0.1.0
inter-process-messaging@0.1.1
jquery@1.11.10
meteor@1.9.3
modern-browsers@0.1.4
modules@0.15.0
modules-runtime@0.12.0
mongo-id@1.0.7
meteor@1.10.0
modern-browsers@0.1.8
modules@0.18.0
modules-runtime@0.13.0
mongo-id@1.0.8
observe-sequence@1.0.16
promise@0.11.2
random@1.1.0
promise@0.12.0
random@1.2.0
react-fast-refresh@0.2.3
reactive-var@1.0.11
spacebars@1.0.9
spacebars-compiler@1.1.0
Expand Down
16 changes: 12 additions & 4 deletions blaze-react-component/blaze-react-component-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ class BlazeReactComponent extends Component {
}

componentDidUpdate(prevProps) {
if (prevProps.template != this.props.template) {
if (prevProps.template !== this.props.template) {
Blaze.remove(this._blazeView);
this.renderBlazeView();
}
}

renderBlazeView() {
this._blazeData = new ReactiveVar(_.omit(this.props, 'template'));
// allow _template to be passed as template to Blaze
let blazeProps;
if (this.props._template) {
blazeProps = _.clone(this.props);
blazeProps.template = blazeProps._template;
delete blazeProps._template;
} else {
blazeProps = _.omit(this.props, 'template');
}
this._blazeData = new ReactiveVar(blazeProps);

let template, tArg = this.props.template;
if (typeof tArg === 'string') {
Expand Down Expand Up @@ -46,7 +55,6 @@ class BlazeReactComponent extends Component {
shouldComponentUpdate(nextProps) {
// this used to be in (the now deprecated) componentWillReceiveProps
this._blazeData.set(_.omit(nextProps, 'template'));

// Never call render() for props except template again; Blaze will do what's necessary.
return nextProps.template !== this.props.template;
}
Expand All @@ -56,7 +64,7 @@ class BlazeReactComponent extends Component {
}

render() {
return ( <span className={this.props.className || ''} ref={(c) => this._blazeRef = c} /> );
return ( <span style={{display: 'contents'}} className={this.props.className || ''} ref={(c) => this._blazeRef = c} /> );
}

}
Expand Down
32 changes: 16 additions & 16 deletions blaze-react-component/package.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
Package.describe({
name: 'gadicc:blaze-react-component',
version: '1.4.3',
name: 'hexsprite:blaze-react-component',
version: '1.4.4',
summary: '<Blaze template="itemsList" items={items} />',
git: 'https://github.com/gadicc/meteor-blaze-react-component',
documentation: '../README.md'
});
documentation: '../README.md',
})

Package.onUse(function(api) {
api.versionsFrom([ '1.3-rc.0', '1.3-beta.10', '1.3-modules-beta.0' ]);
api.use('ecmascript');
api.use('blaze');
api.use('templating');
api.use('underscore');
Package.onUse(function (api) {
api.versionsFrom(['1.3-rc.0', '1.3-beta.10', '1.3-modules-beta.0'])
api.use('ecmascript')
api.use('blaze')
api.use('templating')
api.use('underscore')

api.use('reactive-var', 'client');
api.mainModule('blaze-react-component-client.js', 'client');
api.use('reactive-var', 'client')
api.mainModule('blaze-react-component-client.js', 'client')

api.mainModule('blaze-react-component-server.js', 'server');
api.mainModule('blaze-react-component-server.js', 'server')

api.export('BlazeReactComponent');
api.export('blazeToReact');
});
api.export('BlazeReactComponent')
api.export('blazeToReact')
})

// Note: tests are in test-app, since we can't test-packages with
// peer dependencies.