GithubHelp home page GithubHelp logo

amit-mnnit / react-native-starter-kit-headless-forms Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 314 KB

JavaScript 6.20% TypeScript 33.26% Ruby 15.86% Kotlin 20.34% Objective-C 17.96% Objective-C++ 6.39%

react-native-starter-kit-headless-forms's Introduction

Getting Started with AEM Headless Forms Native App Starter

This is a new React Native project, bootstrapped using @react-native-community/cli.

This application is built to consume the form model definition of an adaptive form.

System Requirements

  • Latest version of GIT

  • Node.js 16.13.0 or later

  • To install Xcode, Android Studio, react native, and other dependencies, follow this link

Start your Application

npm install

Install dependencies.

For Android

npm run android

For iOS

Install pod
npm run ios

If everything is set up correctly, you should see your new app running in your Android Emulator or iOS Simulator shortly provided you have set up your emulator/simulator correctly.

This is one way to run your app โ€” you can also run it directly from within Android Studio and Xcode respectively.

Mappings Object

A Mappings Object is a JavaScript map that maps the field types defined in the Specification to its respective React Component. The Adaptive Form Super Component uses this map to render the different components defined in the Form JSON.

To use that in your project use the following import, assuming you have added the project as a dependency in your project

import {mappings} from '@aemforms/af-react-native'

Once you have fetched the JSON for the form, the code would look like

import {mappings} from '@aemforms/af-react-native'
const json = {...}
<AdaptiveForm mappings={mappings} formJson={json} />

Fetch form definition from AEM Form Server

When you fetch a form from AEM Forms Server, update the following in the constant.ts file.


//  set false to fetch form from AEM Forms Server
export const USE_LOCAL_JSON = false;

// URL of AEM Forms Server
export const AEM_URL = '';

For example,
export const AEM_URL = 'http://localhost:4502';

// Adaptive form path
export const AEM_FORM_PATH = '';

For example,
export const AEM_FORM_PATH = 'content/forms/af/demo-form';

Links

  1. Story book
  2. HTTP API Docs
  3. Adaptive Form Runtime packages

react-native-starter-kit-headless-forms's People

Contributors

amit-mnnit avatar

Watchers

 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.