DEV Community

Cover image for SolidJs: First impression
Edem Agbenyo
Edem Agbenyo

Posted on

12 2

SolidJs: First impression

I have been using React.js for the past 3 years for various projects, and the main reason why I decided to do so were:

  • The ability to use JSX
  • The power to create composable components
  • One-way data binding
  • Reactivity and Virtual DOM
  • Simplicity and Performance

I recently explored SolidJS, a JS library framework and I discovered that you can do all these and even more. Here are my initial thoughts on SolidJS:

  • SolidJS is a declarative, efficient and flexible JavaScript library for building user interfaces.
  • It looks more like functional React components
  • It has its own hooks, the difference being they start with create* while React hooks start with use*
  • SolidJS has 2 main building blocks: JSX Components and Reactive Primitives
  • Components: just like in React are functions that accept props and return JSX elements or other components
  • The Reactive Primitives are made up of Signals(equivalent to State in React), memos and Effects.

There is more to SolidJS, as the above are my initial findings. I will be diving deeper into the topic in my subsequent articles.

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (2)

Collapse
 
lexlohr profile image
Alex Lohr

React components will return virtual DOM, whereas SolidJS components return actual DOM. Instead of reconciliation between virtual and actual DOM, the babel-based compiler creates the scripts required to react on changes to props or changes of memoized signals on compilation. The initial component is only rendered once and changes are applied directly to the DOM.

I recently started writing a selection of components for solid, but it's still in a very early state: github.com/atk/solid-blocks - feel free to give it a spin.

Collapse
 
edemagbenyo profile image
Edem Agbenyo

I will surely take a look at it.

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay