charting-library-examples/react-native
2023-02-07 16:51:27 +00:00
..
__tests__ CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.bundle CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
android CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
ios CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.eslintrc.js Add react native example 2020-12-03 16:10:08 +03:00
.gitattributes [react-native] Add example 2019-03-22 13:22:10 +03:00
.gitignore CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.node-version CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.prettierrc.js CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.ruby-version CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
.watchmanconfig [react-native] Add example 2019-03-22 13:22:10 +03:00
app.json CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
App.tsx CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
babel.config.js Add react native example 2020-12-03 16:10:08 +03:00
Gemfile CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
Gemfile.lock CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
index.js CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
metro.config.js CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
package.json CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
README.md CL-1492: add note about cleaning react-native folder 2023-02-07 16:51:27 +00:00
tsconfig.json CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00
yarn.lock CL-1492: add new react-native example 2023-02-07 14:30:06 +00:00

React Native Example

How to start - Android

  1. Setup the development environment. React Native Docs
    1. Ensure that you follow all the steps for installing dependencies such as node, watchman, Java development kit, and Android development environment
    2. You can return to this guide once you reach the 'Creating a new application' section.
  2. Run "npm install" in the project root folder. Wait until the installation completes.
  3. Open android/app/src/main/assets.
  4. Copy all files from the charting_library repo. The earliest supported version of the Charting Library is 23. If you get 404 then you need to request an access to this repository. Note: Unlike some of the other examples you should copy all files from the repository not just the datafeeds and charting_library directories.
    • The folder structure should resemble this:
      • android/app/src/main/assets/index.html
      • android/app/src/main/assets/charting_library/
      • android/app/src/main/assets/datafeeds/
  5. Run "npx react-native run-android" to start installing the application to a device.

How to start - iOS

  1. Setup the development environment. React Native Docs
    1. Ensure that you follow all the steps for installing dependencies such as node, watchman, ruby (ensure that you install the correct version), xCode, and cocoaPods.
    2. You can return to this guide once you reach the 'Creating a new application' section.
  2. Run "npm install" in the project root folder. Wait until the installation completes.
  3. Open /ios/ChartingLibraryExample.xcodeproj in Xcode.
  4. Right click on the charting_library folder and select "Add Files to ...". Select "Create folder references" for the added folders. This is important because the library contains files with the same name, but in different folders, so the "Create folder references" option adds files to your application bundle with the same folder structure as in the library.
    • Select all the files from the charting_library repo. This should include the html files, and the charting_library and datafeeds folders.
  5. Run pod install within the ios folder
  6. Run "npx react-native run-ios" to start installing the application to a device.

Troubleshooting

If you have previously built an older version of this example in the same folder then you may need to clear out the old build files and artifacts. You can do this with the following command in your terminal (within the react-native folder):

git clean -fdxq .

This will remove all the untracked files in the folder.