SolidJS creator: JavaScript innovation isn’t slowing down

As Solid marks its 1.0 release, creator Ryan Carniato discusses the origins of the framework, the latest JavaScript innovations, and the need to keep pushing front-end JS performance.

1 2 Page 2
Page 2 of 2

Tyson: I think that sense of space to explore is very exciting.

Oh, one more question. I’m curious, did Solid’s createSignal syntax come first, or React’s useState? (Editor: They both use destructuring assignment.)

Carniato: React’s useState came first. I was staring at it for so long just hating every permutation. I was looking at:

const count = createSignal(0)
count.get();
count.set(value);

But I hated it. I knew I didn’t want to do the following either.

count()
count(value);

Nor:

count.value
count.value = value;

I thought of doing:

count()
count.set()

But it felt too clever. Still I needed a primitive so I was going to go with this.

But the plan was to try to push everyone to use what I call createStore now as the main primitive. It used to be called createState after React’s class state. So while I needed signals I figured everyone would just use:

const state = createState({});
state.count;
state.set({ count });

But then the second I saw Hooks I was like... this is it! I have no idea why I didn’t think of returning an array. I’d gone through so many permutations.

I saw it and it just worked. Over time people were more drawn to Signals than createState and it was confusing people coming from React expecting it to be the same as useState. So I renamed it to createStore.

Tyson: It’s funny because when I first saw that syntax in React I was like, what the heck is this thing? But it really works well and it’s compact. 

Copyright © 2021 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2
How to choose a low-code development platform