Giter Site home page Giter Site logo

lcameroon / jhipster-react-web-native-ts Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 1.72 MB

๐Ÿค“ Jhipster web/native (CRA + CRNA + Typescript)

TypeScript 36.77% HTML 0.48% JavaScript 0.53% CSS 51.46% SCSS 10.76%
jhipster react react-native create-react-app create-react-native-app typescript

jhipster-react-web-native-ts's Introduction

React and React Native app + Typescript

React and React Native app provide magic platform-splitting functionality based on special file extensions. Just the component for the target platform is compiled at build time.

Follow these practice:

  • Put the component in a folder
  • Break out the shared interface into a separate .d.ts file.
  • Name the web/default file index.tsx (not index.web.tsx)
  • Name the native file index.native.tsx (both ios and android)
  • For android splitting, add index.android.tsx which will override .native

The .d.ts file enables VS Code code hinting for JSX props, and helps manage the project cross-platform by ensuring the consumers of the component have a unified interface.


Install

Use the NodeJS version 8.11.3

npm install

Run Mock server (Fake Api)

npm run mock:server

Run Web

npm start

Run iOS

npm run ios

Run Android

npm run android

Caution:

Beware auto-imports! It's easy to accidentally import a file like this:

import Header from './Header/index.android';

instead of the correct generic way:

import Header from './Header';

Also, when working on the native app, be mindful that VS Code's Go To Definition will always jump to the index.tsx (web) file.

jhipster-react-web-native-ts's People

Contributors

lcameroon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.