Fork me on GitHub
#clojure-uk
<
2020-04-26
>
Gulli09:04:34

Just ordered my PinePhone!

Gulli09:04:52

Probably going to be crap, but still

dominicm10:04:41

You probably want to order a battery pack too

Gulli10:04:30

@dominicm Does the battery not come with it?

dominicm10:04:19

@glfinn83 it does, but with the battery life being so short...

Ben Hammond11:04:27

React question; I see this error when I try to split functionality into a subcomponent

VM2781 react_devtools_backend.js:6 Warning: Cannot update a component (`) while rendering a different component (`uix.newgame-dialog/switchgroup`). To locate the bad setState() call inside `uix.newgame-dialog/switchgroup`, follow the stack trace as described in 
I appreciate it is telling me that a sub-component cannot start ratttling the cage of a different component's StateHook but doesn't that significantly impair composability of React components?

Ben Hammond11:04:41

I know I can work around this by using a global state manager like xframe.core.alpha but I just want to make sure I've properly understood the issue

Ben Hammond11:04:18

Essentially I have a navbar menu item that flicks the visibilit flag on a Dialog

Ben Hammond11:04:44

and they are in completely different components

Ben Hammond11:04:03

I suppose I could make them the same component and do the portal thing,

Ben Hammond11:04:16

but that would; be proper tail-wagging-the-dog

dominicm11:04:27

No, I think the problem is that you're calling it while rendering!

dominicm11:04:41

You shouldn't have side effects when rendering

Ben Hammond11:04:42

ah right you are

Ben Hammond11:04:20

I was setting default-when-missing values WITHIN the render

Ben Hammond11:04:53

its okay to infer default values within render

Ben Hammond11:04:56

just not to set them

dominicm11:04:47

You can set an initial value for the state

dominicm11:04:00

You may use useEffect if you want to set state on mount

Ben Hammond11:04:51

oooh interesting, hadn't thought of it that way

dominicm11:04:39

I didn't know I was there 😂 I'm not entirely sure why I am, I guess because I was part of the discussions.

dominicm12:04:55

The new slack UI leaves very little vertical space for small (12") screens…

folcon12:04:38

Oh yea, I can’t use slack on a small screen at all!

dominicm13:04:15

ripcord to the rescue :)

folcon13:04:24

Oh nice, how is that?

dominicm14:04:38

I can see all the way up to my conversation with Ben Hammond. Very happy.

folcon14:04:02

Oh cool, so it records local history? Any issues with some of the other functionality like threading or emoji’s/reactions?

clj 4
dominicm14:04:13

Hello, thread

dominicm14:04:52

Works clojurian perfectly :)

dominicm14:04:25

It picks up the history from slack I think, no special recording.

folcon14:04:53

Ah ok, was just wondering if over time it recorded the history, so you could scroll back further than slack lets you see if you had it open…

dominicm14:04:44

No, that would be cool though

folcon14:04:08

As an aside, anyone got any good ways of grabbing the record symbol? I’m trying to do stuff with protocols/records, and I was using the class, but a single namespace reload in my repl means that my old class is not = to my new class… I really want to be able to say things like, give me all the record instances that are this record, or conform to this protocol… I’m beginning to think records/protocols are a bit more trouble than their worth… namespaced maps + multimethods might be better, even with the perf penalty, but it’s not worth doing a rewrite right now… Maybe I spoke to soon, having an atom with some sim state comprised of records+protocols doesn’t work in repl, loading in the ns just breaks everything :(… Looks like it’s time to rewrite everything with multimethods…

folcon14:04:28

why does :clojurian: look like a volcano? clojurian 😕

dharrigan15:04:41

A belated Good Morning!

8
Ben Hammond17:04:57

its always a good morning somewhere

Ben Hammond17:04:06

(if you travel far enough)