Should I learn React Before Learning Clojurescript Om? [closed]
Asked Answered
H

3

5

I'm going to learn Clojurescript for building UIs and I want to use the React wrapper.Should I learn React before diving into Om?

Hoeve answered 2/5, 2016 at 21:19 Comment(1)
I personally eschewed the complexity of Om for the much simpler model used by Reagent. At the time, I knew very little about React, and that has changed little since. However, I would also advise you to learn Clojure(Script) first. How much time to invest depends on whether you are already versed in functional programming and/or other Lisps.Cuspidate
S
9

Learn ClojureScript first, don't even think about React.

The learning curve for Om is not straightforward and you'll need to have a fairly grounded understanding of the fundamentals of the language before some of the abstractions that come with Om make sense (atoms, protocols etc). It's designed to be powerful, not simple and accessible.

Honestly, I'd try Re-agent first. The syntax for describing views is nice out-of-the-box and it'll also help solidify your understanding of atoms. If you like it, then you can complement it with Re-frame for a full blown FRP architecture.

I think it's easier to learn Om coming from Re-agent or Re-frame, than it is from React.

Smuts answered 2/5, 2016 at 22:8 Comment(0)
D
6

No, just dive into Om (or Reagent).

For 99% of UI concerns you won't need to know about the underlying React details, eventually for that 1% of cases you'll need to refer to the React docs.

Dope answered 2/5, 2016 at 21:30 Comment(0)
T
6

I wouldn't worry too much about React. You can learn it through Reagent. Dive straight into Reagent by reading existing code. I started with the Flappy Bird demo and a few others.

To understand React you could look for uses of componentDidMount and the other component lifecycle methods. But honestly you only need to understand these methods for special use cases. Each item having to have a unique key is something that will trip you up, but only for legacy code as that requirement has been removed in the latest version of React.

You could also, even right from the beginning, be reading Om Next code and tutorials. You won't understand them fully right away, but keep having to go back to them. I believe that's the case for everyone!

How you approach it will also depend on whether you are a top-down or bottom-up learner. A bottom-up learner might be delighted to find out from one of the tutorials that queries have metadata linking them to components. On the other hand a top-down learner might be relieved to find a complete application to study. Here's my current best effort at a small Om Next application for understanding purposes.

Tarantula answered 3/5, 2016 at 0:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.