Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use react-mounter on Meteor 1.3+ #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
16 changes: 10 additions & 6 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,29 @@ AccountsTemplates.configureRoute = function(route, options) {
//
// For now we need to render the main template using BlazeToReact

if (Package['react-runtime']) {
if (require) {
var React = require('react');
} else if (Package['react-runtime']) {
var React = Package['react-runtime'].React;
} else {
throw new Error("layoutTemplate is a React element but React runtime package is not found");
}

if (Package['kadira:react-layout']) {
if (require) {
var ReactLayout = {render: require('react-mounter').mount};
} else if (Package['kadira:react-layout']) {
var ReactLayout = Package['kadira:react-layout'].ReactLayout;
} else {
throw new Error("useraccounts:flow-routing requires that your project includes kadira:react-layout package.");
}

if (Package['gwendall:blaze-to-react']) {
var BlazeToReact = Package['gwendall:blaze-to-react'].BlazeToReact;
if (Package['gadicc:blaze-react-component']) {
var BlazeToReact = Package['gadicc:blaze-react-component'].default;
} else {
throw new Error("useraccounts:flow-routing requires that your project includes the gwendall:blaze-to-react package.");
throw new Error("useraccounts:flow-routing requires that your project includes the gadicc:blaze-react-component package.");
}

layoutRegions[contentRegion] = React.createElement(BlazeToReact, { blazeTemplate: template });
layoutRegions[contentRegion] = React.createElement(BlazeToReact, { template: template });
}

function doLayout() {
Expand Down
6 changes: 3 additions & 3 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Package.onUse(function(api) {
'kadira:flow-router',
'underscore',
'useraccounts:core',
'ecmascript'
], ['client', 'server']);

api.imply([
Expand All @@ -29,10 +30,9 @@ Package.onUse(function(api) {
], ['client', 'server']);

api.use([
'[email protected]_1',
'kadira:[email protected]',
'kadira:[email protected]',
'gwendall:blaze-to-react@0.1.2'
//'gwendall:blaze-to-react'
'gadicc:blaze-react-component'
], ['client', 'server'], { weak: true });

api.addFiles([
Expand Down