Fork me on GitHub
#rum
<
2020-09-24
>
sova-soars-the-sora00:09:03

"Warning: Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate." how can I do that

sova-soars-the-sora00:09:13

Hi I figured it out, I was overwriting the same dom component x)

sova-soars-the-sora00:09:32

it turns out that you can do it how i was doing it, as long as the original master component stays on the dom, and you use a different component to load subservient elements into.

cmdrdats14:09:33

You should really not be doing a sideeffect like mounting in a rum component - if you need switching behaviour, simply create a root component that embeds the correct view based on the atom?

cmdrdats14:09:43

For example. Now simply have a button somewhere that swaps your rand-int-majore and you're done.

sova-soars-the-sora14:09:03

Ah I see, I don't actually need to call rum/mount.

cmdrdats14:09:15

I'm also unsure what you were trying to do with the key-fn ?

sova-soars-the-sora14:09:16

just a unique identifier

cmdrdats14:09:59

Hmm, you don't want to be doing side-effects in there either - you don't know how many times the key-fn could be called, or whether it's called again - it should ideally be a consistent value for a given set of arguments to the component

cmdrdats14:09:24

(ie, no (swap! ugen inc) - kinda defeats the point