-
Notifications
You must be signed in to change notification settings - Fork 1
More advanced Reagent techniques
Of Interest:
-
A technique for forcing component re-creation
https://groups.google.com/forum/#!topic/reagent-project/tNY4gzk7TUY -
Getting access to "props" (latest renderer params) in lifecycle functions
http://nils-blum-oeste.net/clojurescripts-reagent-using-props-in-lifecycle-hooks/ -
CSS Animation using React's CSSTransitionGroup
http://www.mattgreer.org/articles/a-game-made-with-reagent/ -
Can Reagent components work with html canvas? https://www.reddit.com/r/Clojure/comments/3cq5hg/can_reagent_components_work_with_html_canvas/
-
Example Of Using DangerouslySetInnerHTML https://groups.google.com/forum/#!topic/reagent-project/PMZPUy5yBCc
If you try to do this:
[:div "hello" " " "there"] ;; <--- note: attempt to use an entity
then you will see the string for the entity. Which is not what you want.
Instead you should do this:
- Require in goog's string module...
(:require [goog.string :as gstring])
- Use it like this ...
[:div "hello" (gstring/unescapeEntities " ") "there"]
Question
So :component-will-receive-props
is a function with this signature (fn [this new-argv])
How do I get new props from new-argv
parameter. It’s a function.
Answer
reagent.impl.util/extract-props
Question
I want to render a table like:
[:table.table.table-bordered
[:tbody
[:tr
[:th {:colspan "2"} "2"]]
[:tr
[:th 1]
[:th 2]]]]
but, when I inspect the rendered HTML in the browser, there is no colspan
property. What have I done wrong?
Answer
https://github.com/reagent-project/reagent/issues/199
Question
I want to use some React components which are packed as CommonJS modules. How do I do it?
Answer
Middleware:
Patterns:
- Solve the CPU hog problem
- Talking To Servers
- Bootstrap An Application
- Debugging Event Handlers
- Debugging
- Testing
- Container Component Macro Ideas
- Alternative dispatch, routing & handling
- A Larger App
- Using Stateful JS Components
- Macros WIP
- Dynamic Subscriptions
- Eek! Performance Problems
General:
Reagent: