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?
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.
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.
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.
© 2022 - 2024 — McMap. All rights reserved.