Fork me on GitHub
#reagent
<
2015-07-30
>
Tom H.08:07:14

@lazy-lambda if you use chrome, check out react tools, it gives you a handy warning when you set the value of an input element but no onChange handler

Tom H.08:07:45

And other similar stuff

Tom H.08:07:00

*react dev tools extension

lazy-lambda08:07:59

@tomisme: Okay, Checking it out.

lazy-lambda18:07:27

is adding stylesheets in app-db considered a good idea ?

roberto18:07:44

i wouldn’t dod that.

roberto18:07:48

stylesheet is not state

lazy-lambda18:07:32

Where should I put visual states then ?

lazy-lambda18:07:39

I was thinking reactive-css

roberto18:07:31

not sure I understand what you mean by ‘visual states'

lazy-lambda18:07:07

Let’s say one of the buttons is green in normal mode but changes it’s color to blue on-hover. If I put the color of the button on app-state and subscribe it, and then on-hover change the app-db color to blue, the button’s color would also change.

lazy-lambda18:07:21

hence reactive-css.

lazy-lambda18:07:35

And the visual state of components.

roberto18:07:16

you should do that with css

roberto18:07:43

well, let me rephrase

roberto18:07:45

I would do that with css

mikethompson18:07:38

@lazy-lambda: you'd normally have some state stored in app-db, like :warnings true and then in your views, you would condition the colour of the button based on that state.

mikethompson18:07:12

The view (or component) is a rendering of the state.

mikethompson18:07:56

In effect, it is not so much that you'd put the colour of the button in app-db ... rather you'd have the state which CAUSED the button to be rendered in a certain colour in app-db

mikethompson18:07:48

Based on the value in app-db (to which you have a subscription) you can add classes to a [:div ] (or not) and add inline styles (or not) etc. These things would control the button colour.

lazy-lambda18:07:24

I prefer inline styles.