A React-Native App written with Kotlin JS
This is an example project to show how you can use KotlinJS to write React-Native Apps. You can click on an floating action button and a counter will update
- android - Base android project directory
- ios - Base ios project directory
- shared - This module is using the Kotlin Multiplatform Plugin, but is only configured to compile to Javascript/React. The main entry of the module is inside the index.kt. In the imports-folder are all relevant wrapper for the React modules. In the ui-folder are all (you might guessed it), ui relevant files
- Install Yarn.
- Run
yarn install
to install all the javascript dependencies. - Run
./gradlew -t :shared:assemble
- compiles the Kotlin javascript module located in./shared
, and watches it for changes. Leave this terminal open. Remove the-t
argument if you don't want gradle to watch for changes and auto-rebuild. - Run
yarn haul start --platform android
. You should now see the message "You can now run the app on your * device" - Run the Android app in an Android emulator. Open the app menu, press Command + M on OSX or Ctrl + M on Linux and Windows. Inside "Dev Settings" disable "JS Delta". Leave the dev settings.
- Changes in the "shared" folder should now trigger the app to update the content. Altenative you can manually trigger a reload in the app menu.
Feel free to send feedback on Twitter or file an issue. Feature requests are always welcome.
This project is licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details
- Support it by clicking the ⭐ button on the upper right of this page. ✌️
Copyright 2019 Jens Klingenberg
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Projects that helped me understand how to setup the project: