Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I haven't used SolidJS, so I can't comment much. But Signals have very good developer ergonomics. But from my experience other frameworks that use them come with drawbacks that I don't get with react. So MobX+React works better for me than - let's say vue.

From a brief look at their website, the downsides for using SolidJs for me seem pretty big. At the very first example, if you change it slightly you can see my problems:

  const CountingComponent = () => {
    const [count, setCount] = createSignal(0);
    const interval = setInterval(
      () => setCount(count => count + 1),
      1000
    );
    onCleanup(() => clearInterval(interval));
    if (count() % 2 == 0) {
      return <div>Even count value is {count()}</div>;
    }
    return <div>Odd count value is {count()}</div>;
  };
1. MobX let's me use objects without additional syntax (createSignal, count() instrad of just count)

2. The fact that the component does not rerender and that my code does not automatically change between even and odd text means I'll probably need to have an additional mental model for writing SolidJS components. Using React+MobX I just write as I would write any other function and it'll just work (There's magic involved, but manageable magic)



There was a debate very recently between SolidJS and React communities over "internalized react-isms" like difference in behaviour you've pointed out. I think it's React that are doing the weird thing and calling your whole function again when one piece of data changes, but I do like having the ability to return early.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: