GithubHelp home page GithubHelp logo

iamchiwon / reactnativeprojectbase Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 18.38 MB

Project Base of react-native with typescript, swift and kotlin

JavaScript 7.21% Starlark 4.40% Kotlin 22.21% Swift 12.57% Objective-C 1.67% Ruby 5.60% TypeScript 25.54% Java 20.81%
react-native typescript kotlin swift nativebase template

reactnativeprojectbase's Introduction

Project base : react-native

react-native project with typescript, swift and kotlin.


react-native


Creation template

npx react-native init {AppName} --template react-native-better-template
  • Customized
    • MainApplication.kt -> MainApplication.java
      : react-native link not works with kotlin file.
    • [android] Use custom font as default
      : android default fonts are sucks.
    • Pre-built components included
      : every project would use them.

Components

Native Base - https://nativebase.io/
yarn add native-base react-native-svg styled-components styled-system react-native-safe-area-context
npx pod-install ios

App.tsx

import { NativeBaseProvider } from 'native-base'

const App = () => {
  return (
    <NativeBaseProvider>
      ...
    </NativeBaseProvider>
  )
}

React Navigation
yarn add @react-navigation/native
yarn add react-native-screens react-native-safe-area-context
yarn add @react-navigation/native-stack
yarn add react-native-gesture-handler
npx pod-install ios

MainActivity.kt

import android.os.Bundle

...

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(null)
}

App.tsx

import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();

export default function App() {
  return (
    <NavigationContainer>
        <Stack.Navigator>
            <Stack.Screen name="Home" component={Home} />
        </Stack.Navigator>
    </NavigationContainer>
  );
}

Vector Icons
yarn add react-native-vector-icons
npx pod-install ios
npx react-native link react-native-vector-icons

Reanimated
yarn add react-native-reanimated@next
npx pod-install ios

babel.config.js

module.exports = {
    ...
    plugins: [
        ...
        'react-native-reanimated/plugin',
    ],
};

โš ๏ธ
Reanimated plugin has to be listed last.
v2.3.x not support react-native v0.65.x

android/app/build.gradle

project.ext.react = [
  enableHermes: true
]

MainApplication.kt

override fun getJSIModulePackage(): JSIModulePackage? {
    return ReanimatedJSIModulePackage()
}

androdi/proguard-rules.pro

-keep class com.facebook.react.turbomodule.** { *; }

Custom Font (Android)
  • Pretendard
  • Use as default font for android. (There are no variable weights for the default Korean font)

Fast Image
yarn add react-native-fast-image
npx pod-install ios

androdi/proguard-rules.pro

-keep public class com.dylanvann.fastimage.* {*;}
-keep public class com.dylanvann.fastimage.** {*;}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

Splash Screen
yarn add react-native-splash-screen
npx pod-install ios

MainActivity.kt

override fun onCreate(savedInstanceState: Bundle?) {
    SplashScreen.show(this);
    super.onCreate(null)
}

Better-Bridging-Header.h

...
#import "RNSplashScreen.h"

AppDelegate.swift

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    initializeFlipper(with: application)

    ...

    RNSplashScreen.show()
    return true
  }



reactnativeprojectbase's People

Contributors

iamchiwon avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.