Fork me on GitHub
#reagent
<
2016-02-19
>
trancehime02:02:00

Odd... on-key-press won't work for trying to make a button clickable via keypress?

slotkenov07:02:27

Has someone managed to get reagent working with radium, or are there better ways of using inline styles for reagent components?

nidu09:02:04

Hello. Have anyone tried to befriend Reagent (or React in general) with Handsontable (https://handsontable.com/)?

Petrus Theron11:02:44

Can you compose components to reagent using partial?

Petrus Theron11:02:21

Looks like I can simple_smile yayy

jaredly16:02:39

does reagent automatically do a :should-component-update w/ equality checks on the props?

jaredly17:02:46

hmm looks like not

jrheard17:02:29

whatcha seeing, jaredly? i'm a rookie here, spent yesterday poring through the reagent source for fun - can't say i understand all of it yet, but i might have seen something like what you're looking for

jaredly17:02:18

oh look at that. @jrheard thanks!

jrheard17:02:56

at this point i understand how RAtoms work, like how they're able to notify the reagent system (via their parent Reaction instance) that their state has changed, and that the root component should be recalculated - but i haven't yet figured out, like, what happens next

jrheard17:02:22

in particular i haven't been able to find anything that looks like a react setState call, which i'd imagine has got to be somewhere in there

jrheard17:02:40

i haven't used react before, but i read through the docs a couple days ago and it looked like setState was the specific way that you communicate updates to the framework

jrheard17:02:47

anyway i'm gonna keep readin'

jrheard18:02:08

hrm. from the om post - "Thus we don't need React operations like setState, which exists to support both efficient subtree updating as well as good object-oriented style. Subtree updating for Om starting from root is always lightning fast because we're just doing reference equality checks all the way down."

jrheard18:02:23

re: my early setstate puzzling, so maybe reagent doesn't have setstate either? i don't understand how anything works without it though

jrheard18:02:44

post goes on to say that "we always re-render from the root" - again, this is om, but that matches what i saw in reagent source

jrheard19:02:25

ok i think it bottoms out in the forceUpdate call in batching.cljs

jrheard19:02:24

"Calling forceUpdate() will cause render() to be called on the component, skipping shouldComponentUpdate(). This will trigger the normal lifecycle methods for child components, including the shouldComponentUpdate() method of each child. React will still only update the DOM if the markup changes."

jrheard19:02:59

i'm sure these notes are useless for anyone except me, but in case they're somehow helpful, the scattered notes i took while i was reading through all this code are at the bottom of https://github.com/jrheard/cljs-sandbox/blob/master/dev-diary.txt

kanwei19:02:26

has anyone gotten (reagent/props) to ever work? Always returns nil for me

kanwei19:02:53

even though :component-will-receive-props does have the right data

mikethompson20:02:44

@kanwei: should work. Here's a code sample.

mikethompson20:02:54

@jrheard: Reagent does not re-render from the root each time. there are various tutorials at the bottom of this page which will should give you a clean mental model: https://github.com/Day8/re-frame/wiki (warning: clean mental models sometimes differ in details from what the code actually does, so certainly reading the reagent code is more accurate :-))

jrheard21:02:31

thx @mikethompson ! been meaning to read the re-frame docs, haven't gotten around to it yet but it's on my shortlist. the scroll bar on https://github.com/Day8/re-frame is so tiny :O

jrheard21:02:40

appreciate the info+link, thanks!

mikethompson21:02:15

There are reagent specific Wiki pages at the bottom of that page.

jrheard21:02:23

oh phew excellent

jrheard21:02:38

oh these topics look extremely relevant