What is metro bundler in react-native?

前端 未结 3 2107
醉酒成梦
醉酒成梦 2020-12-15 03:24

I am learning React Native.

I can\'t find a proper documentation for metro bundler. So, I have few questions on it. As the name suggest it creates a bundle.

3条回答
  •  情书的邮戳
    2020-12-15 03:59

    A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.

    The packager does a few things:

    Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).

    Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.

    reference: https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd

提交回复
热议问题