3

Could someone explain me this:

When I create new React native project with react-native init it also generates .flowconfig

does it also add dependency on flow at the same time?

When using Visual Studio code it provides some intellisense capabilities but I didn't install TypeScript or anything. Do I have to additionally install TypeScript if I want to use TypeScript instead of Flow?

I'm just confused, because in directory of my project I have .flowconfig and when using VS Code it uses TypeScript anyway.

And what if I just want to use Flow and disable TypeScript completely? There isn't much information about it.

1 Answer 1

1

Flow is not being installed with base RN scaffolding. This .flowconfig file is only to help you get efficient type-checking process for Flow, in case if you're willing to use Flow. Otherwise, you can delete it. Note that to use Flow you still have to install some packages and maybe editor plugins, also its better to turn off vscode analysis.

TypeScript has to be configured too, even if vscode uses it undercover. One thing (1) is to get intellisense & other helping stuff inside editor and other thing (2) is to use TS to transpile your code.

In first case you can grab some type definitions and feel almost happy with raw JavaScript - vscode still helps with some tips and suggestions. For this I used vscode-react-native plugin, which downloaded RN's type definitions.

In second case - tbh, I don't know much about how popular TS is among RN devs, but you can grab some setup from create-xp-app or similar projects.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.