0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

solidjsで困ったところメモ

Last updated at Posted at 2022-07-16

1. Storeがよくわからない

ストアという言葉に混乱したけど、シンプルに「オブジェクトをリアクティブに使える仕組み」のようです。
vue3のreactive()みたいな感じかな?

vuexとかreduxのようなグローバルなステート管理の話ではないです。
↑ずっとこういう話だと思いこんでいて、公式サイトを読んでもさっぱり意味がわからなかった…

#ストア
これらの API は solid-js/store で公開されています。これにより、Signal のツリーを個別に追跡・変更できるプロキシオブジェクトであるストアを作成できます。
(公式サイトより)

solidjsのcreateSignalcreateStoreexportしておけばどこからでもimportして使えるので、特別にグローバルなステート管理の仕組みは必要ないようです。

参考

https://qiita.com/shadowTanaka/items/419dc9e7db98971ff818
こちらの記事が大変参考になりました。
というかこちらの記事がなければ理解出来なかったと思います。
大感謝。

2. inputonChangeが想像通りに動かない

onInputを使います。

参考

#3. icon
font-awesomeとか使いたいけど専用パッケージ無いな〜とか思ってたら強いのがありました。
https://solid-icons-web.vercel.app/


随時加筆します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?