FurkanO
FurkanO

Reputation: 7308

How to set up React with Meteor?

I have started learning meteor and decided to use it with react. Since one month, I had issues about which packages I should use.

At the end of the day , I know I should use webpack for codesplitting, react-router since it promises much more compatibility with other stuff related to react and lastly I don t want server-side-rendering since it lacks many of the things I want in my application( in short responsiveness of my app ).

Anyway, I checked lots of repos on github and read many articles etc. Since first day , I still hate meteor + react because it s been very confusing to decide between different combinations of using packages.


Finally my question is about which of the packages for data I should use with my pack. So my pack consists of

  1. react
  2. react-dom
  3. react-router
  4. webpack
  5. babel

Which of the followings should I use to complete my pack.

  1. react-meteor-data
  2. react-mounter
  3. anything else ?

I don t really know how meteor bootstraps, how it handles data, how it passes data to react, why are there weird mixins used within many projects on github etc. I am really exhausted. I should start my project and finish. Still trying to figure out how meteor works and choose between those packages.

Upvotes: 0

Views: 173

Answers (1)

aedm
aedm

Reputation: 6624

If you're a beginner, I'd advise to use the following setup instead:

  • React. Install the npm package instead of what you find on Atmosphere, they're for an older version of Meteor, where npm support wasn't really a thing yet.
  • Flow Router integrates really well with Meteor, it's really straightforward to use. Provides reactive variables and even server-side rendering, that will come in handy later when optimize your app for SEO.
  • react-meteor-data is responsible for connecting Meteor and React. It provides the createComponent function that can turn Meteor subscriptions into React properties.
  • react-mounter from npm. Use it when you define Flow Router routes to mount your React components to the DOM.

That's the basics you'll need to make an awesome webapp with Meteor and React. :)

At the beginning I'd skip webpack. It's awesome, but can easily make your learning curve a bit too steep. You'll know when to switch to it.

Upvotes: 1

Related Questions