1
1

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.

【メモ】React Native + Expo + TypeScript で使える(使えてる)npmパッケージまとめ

Last updated at Posted at 2021-09-26

はじめに

元々SwiftでiOSアプリを作ってプログラミングを始めたのですが、web開発をやるにつれ、ネイティブアプリをTypeScriptで書きたいと思うようになり、React Nativeに手を出しました。

また、CocoaPodsだのあーだこーだをよしなにやってくれるExpoを使うようにします。

ただ、Expoで動くnpmパッケージが限られており、またTypeScript環境で型定義ファイルを用意してくれているnpmパッケージも限られています。

なので、Expo + TypeScriptで使えるな〜と思ったnpmパッケージを随時追記していきます。

npmパッケージ一覧

react-native-dotenv, @types/react-native-dotenv

このパッケージで環境変数が使えます。

参考URL: https://dev.to/bhatvikrant/how-to-add-environment-variables-in-a-react-native-project-with-ts-2ne5

型定義ファイルのパッケージも提供されています。

react-native-storage

これでlocalStorage的なものが使えます。セキュリティ的に問題ないデータをとりあえず端末に保存できます。

参考URL: https://zenn.dev/nekoniki/articles/b295b0d123f7b1

expo-secure-store

このパッケージでsecureなlocalStorage的なものが使えます。keychain的な?

参考URL: https://docs.expo.dev/versions/latest/sdk/securestore/

tailwind-rn

このパッケージでReact Nativeでもcssパッケージのtailwindが使えます。

参考URL: https://zenn.dev/shon0/articles/3157650d9b3cb1b0eb41

参考URLの手順を踏むと、途中で

Cannot find module 'tailwindcss'

とか怒られるかもしれませんが、普通に

expo install tailwindcss

とすれば、問題なく使えます。

tailwind-rnのgithubSupported Utilities でクラス名の一覧がまとめられてます。

最後に

これからどんどん追記していくと思います。
まだまだReact Native触りたてなので、なんかあったら遠慮なくコメントください

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?