meteor-useraccounts / flow-routing

Useraccounts packages add-on for integration with Flow Router and Blaze Layout.
https://atmospherejs.com/useraccounts/flow-routing
MIT License
72 stars 50 forks source link

Breaks with Meteor 1.3 and FlowRouter when using npm react #32

Open robinnewhouse opened 8 years ago

robinnewhouse commented 8 years ago

I followed the tutorial at https://voice.kadira.io/getting-started-with-meteor-1-3-and-react-15e071e41cd1#.nftvsfia4 on creating an app that no longer depends on meteor's react but allows for installation of react and react-dom through npm. Now my useraccounts throws an error as it appears to have ReactLayout as an explicit dependency

Perhaps you could use the "react mounter" npm package that flow router now uses. https://github.com/kadirahq/react-mounter

jshimko commented 8 years ago

I haven't personally used react mounter yet. Is that going to work with Meteor 1.2? If not, I think we'll need to wait until 1.3 is official to make that change.

Also, we're always open to pull requests. ;)

robinnewhouse commented 8 years ago

Thanks for the reply. I suppose it does make sense to stick with the stable version at the moment. I'm still pretty new to this whole landscape of web development, but if I manage to modify something I think worth pulling I'll make a request.

ziarno commented 8 years ago

:+1: please add support for react-mounter! :)

nickeday commented 8 years ago

+1 for supporting react-mounter please! I'm updating my app to Meteor 1.3 and have just encountered this same issue.

jshimko commented 8 years ago

Pull requests welcome. ;)

diegonc commented 8 years ago

Hi

I'm going to try to use useraccounts with React and Flow Routing. So I created PR #47 (untested) to fix this issue. @jshimko, it would be great if you could review it and comment on any foreseeable problem.

As my project progresses to a functional state (currently it's blank :) I will eventually test the PR and report back.

Cheers!

diegonc commented 8 years ago

Well, it didn't work. The blaze-to-react version in atmosphere brings react and conflicts with the one installed through NPM.

diegonc commented 8 years ago

Ok, now it works. I replaced gwendall:blaze-to-react with gadicc:blaze-react-component; so it seems to be an issue in the published version of blaze to react.

Furthermore, I'm not sure whether it remains backwards compatible because I also had to use ecmascript for require; nor I can think of a way to allow prior versions of Meteor :(

isAlmogK commented 7 years ago

Has this been fixed? Wanted to know if it's possible to use accounts with react?

lmachens commented 7 years ago

If you want to use react-mounter or don't like any dependencies with atmosphere packages -> try out #53. There is a discussion about a new layout type custom #33 .

Example:

import { mount } from 'react-mounter';

AccountsTemplates.configure({
  defaultLayoutType: 'custom',
  defaultCustomRender: (layoutTemplate, layoutRegions) => {
    mount(layoutTemplate, layoutRegions);
  },
  defaultLayout: MainLayout,
  defaultLayoutRegions: {},
  defaultContentRegion: 'main'
});

AccountsTemplates.configureRoute('signUp', {
    name: 'signUp',
    path: '/sign-up',
    template: <SignUp />
});