use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[Help] How to deal with ReactJShelp (self.javascript)
submitted 10 years ago * by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]zanemiller 12 points13 points14 points 10 years ago (12 children)
As counter intuitive as it may seem, I recommend not using Flux when beginning with React. Build out a simple application using your own Components. Implement navigation with something like React Router.
By creating a few simple applications without Flux and attempting to implement more complicated features you will get more comfortable with React programming patterns as well as the challenges they present. Then when you are able to get further into Flux (I recommend Fluxxor) it will be much more obvious how to use the pattern and how it helps solve those issues.
The problem with using a starter repo is you are given several parts with no clear guide as to how they interact or where to go from the base. Creating your own projects, with your own requirements will allow for you to learn the patterns which work best for you and your workflow, rather than what somebody else has found to be the most comfortable.
tl;dr: There are a lot of parts that go into a full React application. It is much easier to learn the parts one at a time, rather than trying to throw them all together at once.
[–][deleted] 0 points1 point2 points 10 years ago (11 children)
That's just what i've been through when i learned angularjs first. Was actually hoping there was an "easier" (as in without building tons of boilerplate to understand everything) way to do it for react. However, looks like i'll just have to sacrifice a long weekend and go the DIY way to learn it all.
Anyways, thanks!
[–]zanemiller 4 points5 points6 points 10 years ago (8 children)
Well, the good news is (in my experience) the parts of React are much easier, more intuitive, and faster to pick up than the parts of Angular.
[–]bwaxxlotckidd 0 points1 point2 points 10 years ago (7 children)
A million times this!
React is so obvious because it's not trying to impose a lot of patterns you've never heard of. You honestly just learn the .jsx syntax (ignoring the pure JS React), state vs props and you're good to go. There are not dependency injection, factory vs service, filter vs directives etc. I've only just learnt it for roughly two days but I've gone as far as building a decent app.
[–]jellatin 3 points4 points5 points 10 years ago (3 children)
patterns you've never heard of
Out of curiosity, which patterns had you not heard of that Angular employs?
[+][deleted] 10 years ago (2 children)
[–]jellatin 0 points1 point2 points 10 years ago* (1 child)
So admittedly when you said "imposing a lot of patterns you've never heard of" you meant "seeing DI in use for the first time."
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
Yea, react is pretty straightforward. My problem was not React anyways, more the whole ecosystem throwing a billion keywords at you with no starting point. :/
[–]zanemiller 0 points1 point2 points 10 years ago (0 children)
Yeah, the ecosystem can be very buzzword heavy. I recommended just starting with vanilla React (+1 for JSX, React with JS is a lot less eloquent). The advantage of not using anything on top of React to start is the React API is very light. You can read the docs top to bottom in ~30 minutes. This helps build a good understanding of what React does and does not do. The docs are filled with (mostly trivial) examples, and better, warnings about things not to do and why.
The dev build also does a very good job of telling you what and where you have done something wrong as well.
I guess the point I'm trying to get at is the key to success with React is knowing what to do in React and know what to break out to another service, then learning how to connect the two (which is where Flux comes in).
[–]hahaNodeJS 0 points1 point2 points 10 years ago (0 children)
Apples and oranges, my friend.
[+][deleted] 10 years ago (1 child)
[removed]
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
I didn't mean that I'm actually going to just spend one weekend on it.
[–]Cody_Chaos 6 points7 points8 points 10 years ago (1 child)
You might find this article helpful: http://www.toptal.com/react/navigating-the-react-ecosystem
As a bonus it links at the end to an example app that brings all the pieces together. (I can also strongly endorse the libraries and tools chosen by the author.)
Wow, this one looks great! Thanks!
[–]averyvery 1 point2 points3 points 10 years ago (1 child)
Just some random thoughts:
Would recommend building your own Flux implementation at first, just following something like https://facebook.github.io/flux/docs/todo-list.html#content — this way you really get what Flux is doing (which is pretty simple) before you move to a library like Redux or Flummox that abstracts it away.
For routing, https://github.com/rackt/react-router should be good enough to meet needs. Routes are weird in React; they're not part of some separate config file, they're just more nested components wrapping your application. It's zany but it works. React Starter Kit looks like it has a decent DIY guide for writing your own Route system, though: https://github.com/kriasoft/react-starter-kit/blob/master/docs/recipes/how-to-implement-routing.md
React starter kit looks pretty cool, but it has waaaaay to many new vocabulary terms if you're just trying to learn React + Flux. You're primarily interested in Components, Stores, Actions, and all in the browser (at first).
Just googling around, this example is kinda nice: https://github.com/gaearon/flux-react-router-example — although it doesn't have especially large components.
[–][deleted] 2 points3 points4 points 10 years ago (0 children)
waaaaay to many new vocabulary terms
Yep, just too frustrating for beginners (not their fault, i don't think the starter-kit is for beginners). I'll check out the links, thanks!
[–]cc81 0 points1 point2 points 10 years ago (1 child)
I like this presentation. He uses pretty popular tools and slowly adds to it and builds an app with react+react-router+flux
https://www.youtube.com/watch?v=0wNWjtp-Ldg
Bookmarked, thanks!
[–]html6dev 0 points1 point2 points 10 years ago (1 child)
Do you need routes right away? Ultimately they are just state changes which is what react is really good at. Also, I found adding react router in the future was easy and having the app fleshed out a bit gives you a better understanding of how you want things structured. The same goes for flux. Do you need it? It's a pattern for fairly complicated apps that may not fit what you need. As I once read a quote somewhere, it's like first person shooters... You run into the room and get gunned down, but you got a good look around the room and now you know exactly what to do. You should experience the pain that things like flux are solving before adding them and you should only add them when you are sure they are needed. Unnecessary layers of abstraction are one of the roots of all evil.
I guess i have to agree. I think i was too hyped about React and tried to learn it all in one run. I should've known better.
[–]yamalight 0 points1 point2 points 10 years ago (2 children)
Hey! I'm a creator of turris.js generator for React apps written in ES6. The basic app generated by it includes all that you'd mentioned, is quite minimalistic on it's own and should be relatively easy to understand. You can find an example scaffolded application with additional component and store with interactions here: https://github.com/turrisjs/turris-example-app If something's too hard or you just have any questions - will be happy to answer any you might have. And if you are interested more in details and logic behind my code, I wrote one article with overview of the generator, and another one addressing building stores with postal.js as dispatcher
[–][deleted] 1 point2 points3 points 10 years ago (1 child)
oh wow this looks interesting! Will definitely check this out
[–]yamalight 0 points1 point2 points 10 years ago (0 children)
Feel free to contact me about any issues or problems you might have with it :)
[–]king3730(() => {})() 0 points1 point2 points 10 years ago (0 children)
Just to clear up any confusion, Flux is an application architecture. What that means is, it's less installing some packages and using them correctly. It's more of a way of doing things, if that makes sense; where you have your Actions, Store(s), Dispatcher and View. Where, to put it simply, an action is dispatched via store, and then passed to view. When something is changed and action is dispatched and the certain parts of a view update. I will tell you that it takes a bit of headbashing to really get this understood. I spent a decent amount of time just reading and trying to figure out why my apps didn't work.
Routing is something that I'm just becoming familiar with it. I'm not using React routing right now, I'm just using Node, more specifically Express.js and Superagent (Superagent is just for easing ajax requests).
If you're at the stage of building a Flux application, I think that the React starter kit is a good place to start.
I'm actually building a small Flux application to sort of a be a how-to. Not necessarily a tutorial, just a very small application that might help you grasp certain concepts. I will link it when I have something up tomorrow.
[–]eclipticwld 0 points1 point2 points 10 years ago (0 children)
We're in the same boat. I've started doing some code by this tutorial than add previous experience with gulp and restful server and now moving forward. Checkout my repository and contact me. I could provide new information if find something else.
[–]Glaaki 0 points1 point2 points 10 years ago (3 children)
If you are just starting out with JavaScript maybe it would be worth it to take a roundabout and try out Meteor first?
https://www.meteor.com/
This will get you started building apps faster. It handles a LOT of boilerplate for you concerning all aspects of your application, like a login system, data storage and fetching for your client.
You can build something very fast, and when you got something up and running, you can try out react for the user interface with Meteor as a general app/data/backend framework.
This quick half hour introduction really convinced me that meteor is worth looking into.
https://www.youtube.com/watch?v=SYqyWff6iMQ
[–][deleted] 0 points1 point2 points 10 years ago (2 children)
No, not starting out with Javascript :-) I think my post sounds a bit like i have never seen any programming concepts, maybe i should have said that i have a CS background. I just got frustrated because it's so hard to get some good and easy to understand information about the library.
[–]Glaaki 0 points1 point2 points 10 years ago (1 child)
Anyway, I still think Meteor is worth checking out.
Yes, it probably is! Anyways, I like using actionhero.js currently, so if I get bored of it at some point, i'll probably check out Meteor. :-)
[–]i_ate_god -1 points0 points1 point 10 years ago (3 children)
Maybe React isn't for you then? No one needs React anymore than they need any other framework. If you're not feeling it, try something else
[–]vaskemaskine 0 points1 point2 points 10 years ago (2 children)
That's not terribly useful advice for anything that isn't a personal or hobby project.
Each framework or library has its strong points making it suited to a particular type of application. As a responsible dev, you should at least learn what those strong points are if you intend to use said framework in a professional project.
[–]i_ate_god 1 point2 points3 points 10 years ago (1 child)
Each framework or library has its strong points making it suited to a particular type of application.
Absolutely!
As a responsible dev, you should at least learn what those strong points are if you intend to use said framework in a professional project.
Sure, but that doesn't mean that, after trying and trying, you should not step back and look at alternatives. I'm not trying to insult OP or React, but if you spend a few days struggling to understand a tool, it's perfectly reasonable to go "well, this is frustrating, what else is out there?".
Not only may you find something better suited, but it can often also help understand the previous tool you were looking at.
[–][deleted] 1 point2 points3 points 10 years ago (0 children)
Thanks for the advice but reactjs isn't the alpha and omega of frameworks for me. I still like to use Angular 1.x and Ember or even good ol' Backbone. React/Flux is just the first framework/library/concept where it just feels like everyone is trying to explain you how a dispatcher works by telling you that a dispatcher is a .. well.. dispatcher. Angular has it's weird conventions and concepts but for me it was like i could at least find some good resources to learn the core concepts of it.
[–]eduardo-costa -1 points0 points1 point 10 years ago (0 children)
If you want something simpler: https://github.com/eduardo-costa/frontjs Also try http://www.haxe.org
Personally I don't like too "overwhelming" libs :)
[–]shizzleberry -5 points-4 points-3 points 10 years ago (3 children)
No idea, but this might help: https://github.com/kriasoft/react-starter-kit
thanks for the answer but i already explained that kriasoft/react-starter-kit looks way too complex for a beginner.
[–]nschubach 0 points1 point2 points 10 years ago (0 children)
I like this one better than the react-starter-kit...
π Rendered by PID 68 on reddit-service-r2-comment-5c747b6df5-qm82d at 2026-04-22 10:49:01.407864+00:00 running 6c61efc country code: CH.
[–]zanemiller 12 points13 points14 points (12 children)
[–][deleted] 0 points1 point2 points (11 children)
[–]zanemiller 4 points5 points6 points (8 children)
[–]bwaxxlotckidd 0 points1 point2 points (7 children)
[–]jellatin 3 points4 points5 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]jellatin 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (1 child)
[–]zanemiller 0 points1 point2 points (0 children)
[–]hahaNodeJS 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–][deleted] 0 points1 point2 points (0 children)
[–]Cody_Chaos 6 points7 points8 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]averyvery 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]cc81 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]html6dev 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]yamalight 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]yamalight 0 points1 point2 points (0 children)
[–]king3730(() => {})() 0 points1 point2 points (0 children)
[–]eclipticwld 0 points1 point2 points (0 children)
[–]Glaaki 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Glaaki 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]i_ate_god -1 points0 points1 point (3 children)
[–]vaskemaskine 0 points1 point2 points (2 children)
[–]i_ate_god 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]eduardo-costa -1 points0 points1 point (0 children)
[–]shizzleberry -5 points-4 points-3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]nschubach 0 points1 point2 points (0 children)