Fork me on GitHub
#reagent
<
2016-06-12
>
joshjones03:06:07

@plexus: got it all hooked up, pulling data from the database and showing a nice highcharts chart. thanks so much for your help!

joshjones03:06:17

This method uses static routes and it's good enough for my purposes now, since the charts I'm defining will be pretty static. Now I'm curious how dynamic routes that would be used in a more complex REST setup (if I were actually serving clients, instead of myself, with potentially complex request paths) would be implemented

plexus08:06:23

you would write routes that take parameters, either as GET url params, or in a POST, can be simple flat x-www-form-urlencoded, or rich JSON/Transit/EDN data that you're posting to the server, then it can generate data dynamically based on that

plexus09:06:11

what's up with "ReagentInput"?

plexus09:06:06

where it says in a certain case " reagents "ReagentInput" hack won't work"

plexus09:06:12

what's the hack for?

plexus09:06:24

I guess this explains it

plexus09:06:26

;; Don't rely on React for updating "controlled inputs", since it
  ;; doesn't play well with async rendering (misses keystrokes).

plexus09:06:38

what I assume that means is that because Reagent batches render calls and flushes them in a requestAnimationFrame, this interferes with Reacts "controlled input", and so it re-implements its own version of controlled inputs. Is that correct?

plexus10:06:40

;; For backward compatibility
(def as-component as-element)
(def render-component render)
(def render-component-to-string render-to-string)

plexus10:06:25

Does this mean the function names on the left are deprecated in favor of those on the right? so render preferred over render-component?

plexus10:06:42

that's how I'm reading that, but the docs at http://reagent-project.github.io/ use render-component so not sure

gadfly36112:06:24

@plexus that is correct, most of those renames are from v0.5.0, notes in the changelog

plexus15:06:17

@gadfly361: do you know about ReagentInput (see my previous question)?

gadfly36118:06:21

@plexus I don't know about it, but this PR comes to mind, possibly relevant: https://github.com/reagent-project/reagent/pull/126