Git Product home page Git Product logo

react-native-nano's Introduction

Overview

Nano helps you to develop complex mobile apps with low code (in JSON).

Links

nanoapp.dev | Playground

What is it ?

react-native-nano helps you to quickly develop complex mobile apps with low code (in JSON). Here are some of the benefits you get out of the box when you use Nano.

  1. No need to manage any state variables.
  2. Ease of creating new components using JSON.
  3. Easy to place components in horizontal and vertical directions.
  4. Ability for every component on the screen to access and change the every other component.
  5. Ability for all action/life-cycle event methods to have control over database, navigation, uiElements, notifications and session.
  6. Separating Ui from Logic 100%.
  7. Ability to load UI (JSON) from your own server.

DEMO

Try it here.

Documentation

For more detailed documentation please click here

How to Install ?

For Newer Apps:

For newer apps, we recommend you to create new Nano app by using below command.

for latest version

    npx use-nano init MyFirstNanoProject 

for specific versions of react-native and react-native-nano versions

    npx use-nano init MyFirstNanoProject --nano-version 1.0.115 --react-native-version 0.72.6 

For Existing Apps:

You can install react-native-nano in your react-native app by using the below command.

    npm install react-native-nano --save

The above command will install necessary packages to run react-native-nano with react-native . You can use all react-native commands to start and run in Android and IOS.

How to use ?

Adding single screen:

When using Nano, creating components is little bit different from a typical react native project. In Nano, we create component in the form of JSON and add it to NanoApp component. Nano will render the component on screen.

For example, below is the text component.

import { NANO } from  'react-native-nano';

const text = {
  component: NANO.TEXT,
  name: 'text',
  value: 'This is the sample text',
};


const screen = {
    name: 'WelcomeScreen',
    screen: {
	v1: [text],
    },
    props:{
        style: { flex: 1, justifyContent: 'center' }, 
    }	
};

Nano makes it easy to place components in horizontal and vertical directions in a screen. It uses horizontal and vertical keys read more about them here.

And after that simply add it to the NanoApp component like below

import {NanoApp} from  'react-native-nano';
...
const  App = () => {
    return <NanoApp screens={[screen]} />;
};

export  default  App;

Adding multiple Screens

You can actually add as many screens as you want to NanoApp component just like below

const  App = () => {
    return <NanoApp screens={[
                             screen1, 
                             screen2, 
                             screen3, 
                             screen4
                             ...
                             
                             ]} />;
};
export  default  App;

Simple Counter App

The following code is an app that increases number on button clicks.

import { NANO } from  'react-native-nano';
	
// creating a text component to display numbers starting from 1.
const  countText = {
    component:  NANO.TEXT,
    name:'text',
    value:  1,
    props: {
	style: {
	    fontSize:  50,
	    alignSelf:  'center',
	    justifyContent:  'center',
	}
    }
};

// creating a button component to click and increase numbers.
const  increaseCountButton = {
    component:  NANO.BUTTON,
    value:  'CLICK ME TO INCREASE',
    onPress: ({setUi, getUi}) => {

            // increase count by 1
            const textObj = getUi("text")
            textObj.value = textObj.value + 1
            setUi("text", textObj)

    }
};

// Finally adding both components to screen with v1(vertical) tag.
const screen = {
    name: 'CountScreen',
    screen: {
	v1: [countText, increaseCountButton],
    },
    props:{
        style: { flex: 1, justifyContent: 'center' },
    }
};

Nano makes it easy to place components in horizontal and vertical directions in a screen. it uses keys v1, v2, v3, v4, v5 ..... vn to place components vertically and uses keys h1, h2, h3, h4, h5 ..... hn to place components horizontally.

Now add the above screen to the NanoApp component as shown below in the App.js file.

import {NanoApp} from  'react-native-nano';
...
const  App = () => {
    return <NanoApp screens={[screen]} />;
};
export  default  App;

The above code displays text and button. When button is clicked the count text gets increased.

Dependencies

react-native-nano depends on following packages

  1. react navigation
  2. react native paper
  3. realm
  4. recyclerlistview
  5. react native vector icons
  6. react native animatable
  7. react native reanimated

react-native-nano's People

Contributors

sandarshnaroju avatar sandeshnaroju avatar deepakkumardk avatar

Stargazers

Giorgio avatar MohamedGado avatar 高昇 avatar Johan Haneveld avatar Karl Lopez avatar Akhil Pillai avatar Kirill Custom avatar Alberto avatar jET avatar Paul Myburgh avatar GarioTV avatar Everaldo Junior avatar  avatar Omkar Kulkarni avatar Tomáš Šesták avatar sco avatar Zach avatar Rehan Fazal avatar Akki avatar Uros Durdevic avatar  avatar Ndubuisi Nwiziogoede avatar sumit kumar avatar  avatar Shail Patel avatar Eugene Klimov avatar  avatar Zafar Ansari avatar Joohun, Maeng avatar hendriady avatar  avatar Osama Abdalla  avatar Siddharth Jindal avatar zetsukhun avatar  avatar  avatar Sandeep avatar Pham Tuan Anh avatar Michael Demarais avatar Nimit Savant avatar Maxvyr avatar Kevin'S Assi avatar Alvar Hansen avatar Floyd Kim avatar MdShkArif Shaik Arif Diggi avatar Daniel Phan avatar Joshua Moreno avatar Nic Bovee avatar  avatar  avatar Niloy avatar Seifeddine Largat avatar Shair avatar The Artifex avatar Efstathios Ntonas avatar Breno Uchôa - DSuite avatar Ворон avatar Mark Kaliada avatar Sheehan Toufiq Khan avatar Sohan Chotia avatar  avatar DCALDERONV avatar Ng Han Seng avatar Karsten Gresch avatar chris eliezer avatar  avatar Xavier Vila Rubio avatar Uuganbayar avatar Omer Quadri avatar Motyar avatar Miki Oracle avatar eunho avatar Andrei Surugiu avatar Porramate Lim avatar  avatar Max avatar Kai avatar Cais avatar Tim Kersey avatar  avatar

Watchers

 avatar  avatar

react-native-nano's Issues

important

Hi with last version of react native nano i canno hide appbar with "headerShown": false and style had any effect

why ?

const splashScreen = {
name: 'SplashScreen',
screen: {
v1: [avatar_image, countText, customWBView, customMLView, customDRView, next],
},
onStart:({ route, setUi, getUi })=>{
NetInfo.fetch().then(state => {
if( state.isConnected == true ){
/setTimeout((e)=>{
navigation.push("loginScreen")
},1000)
/
}
else{
Alert.alert("Error:: network connection failed, Check your connection.");
}
});
},
onEnd:({ route, setUi, getUi })=>{

},
onResume:({ route, setUi, getUi })=>{

},
onPause:({ route, setUi, getUi })=>{

},
screenProps: {
options: {
"headerShown": false
}
},
style: { flex: 1, justifyContent: 'center', backgroundColor: "#222222" },
};

Conditionally render a component

First Thanks & great job on this library, it really helps to make MVP quickly.

How can we render a component conditionally based on state (nano value key), a simple use case would be I want to show the image/video only after the user has selected it, so in the image/video component I need to set value: getUi('selectedFile').value but since value is not a function we can't do that also it hasn't the short circuit thing handled.

The hotfix for now would be to make our custom component for Image and Video which will handle the null value, but if that can done with nano that would be great.

question

Hi, i have question what is ndk version for last version and alse gradle version and java jdk version
thanks

Centralize the app header bar

Is there a way to centralize the app bar, like I want to change the style and alignment of the title, can it be done in one place, I couldn't find any doc related to it.
It would be beneficial to find these issues on your own if the library has support for typescript. Any plans for it?

navigation

hello, I was able to create a project with the latest version of react and nano and it works very well I had to import all the dependencies manually but I cannot use navigation

this is my index ( ERROR ReferenceError: Can't find variable: navigation )

/**

  • Sample React Native App
  • https://github.com/facebook/react-native
  • @Format
    */
    import React from 'react';
    import { NANO } from 'react-native-nano';
    import {RNNano} from 'react-native-nano';
    import { Alert } from 'react-native';
    import NetInfo from "@react-native-community/netinfo";

/**
*

  • Component Definition

*/
const avatar_image = {
component: NANO.AVATAR_IMAGE,
value:
'https://miro.medium.com/v2/resize:fit:1024/1*QY5S4senfFh-mIViSi5A_Q.png',
props: {
size: 250,
color: 'red',
style: {backgroundColor: 'blue',alignSelf: 'center', justifyContent: 'center'}
}
};

const countText = {
component: "text",
name:'text',
value: "Welcome",
props: {
style: {
color: "white",
fontSize: 30,
alignSelf: 'center',
justifyContent: 'center',
}
}
};

const headerText = {
component: "text",
value: 'Todo App',
props: {
style: { fontSize: 16, fontWeight: "bold", textAlign: "center", color: "white", paddingVertical: 12, backgroundColor: "#6559cc", position: "absolute", top: 0, left: 0, right: 0, zIndex: 3 }
}
};

const loginInput = {
component: "text_input",
name: "text_input1",
props: {
style: { marginTop: 70, width:220, alignSelf: 'center', justifyContent: 'center' },
color: 'blue',
mode: "outlined",
label: "Login",
placeholder: "Add our login ...",
}
};

const passwordInput = {
component: "text_input",
name: "text_input",
props: {
style: { width:220, alignSelf: 'center', justifyContent: 'center', marginTop: 5 },
mode: "outlined",
label: "Pwd",
placeholder: "Add our password ...",
}

};

const countText1 = {
component: "text",
name:'text',
value: "Welcome to \nReact Native Apps",
props: {
style: {
fontSize: 30,
alignSelf: 'center',
justifyContent: 'center',
}
}
};

const connexion = {
component: NANO.BUTTON,
canChangeEffect: true,
value: 'Connection',
props: {
style: { marginTop: 20, width:220, alignSelf: 'center', justifyContent: 'center', elevation: 5, backgroundColor: '#6559cc' },
color: "white",
mode: "outlined",
borderRadius: 10,
},
hide: false,
onPress: ({setUi, getUi}) => {

  // increase count by 1
  const textObj = getUi("text")
  textObj.value = textObj.value + 1
  setUi("text", textObj)

}
};

const fab = {
component: NANO.BUTTON,
canChangeEffect: true,
value: '+',
props: {
style: { position: 'absolute', margin: 16, right: 0, bottom: 0, marginTop: 20, width: 64, height: 64, alignSelf: 'center', justifyContent: 'center', elevation: 5, backgroundColor: '#e74c3c',borderTopLeftRadius: 50,borderTopRightRadius: 50, borderBottomLeftRadius: 50, borderBottomRightRadius: 50,textSize: 45 },
color: "white",
mode: "outlined",
borderRadius: 10,
},
hide: false,
onPress: ({setUi, getUi}) => {

}
};

/**
*

  • Screen definition

*/

const splashScreen = {
name: 'SplashScreen',
screen: {
v1: [avatar_image, countText],
},
onStart:({ route, setUi, getUi })=>{
NetInfo.fetch().then(state => {
if( state.isConnected == true ){
setTimeout((e)=>{
navigation.push("loginScreen")
},1000)
}
else{
Alert.alert("Error:: network connection failed, Check your connection.");
}
});
},
onEnd:({ route, setUi, getUi })=>{

},
screenProps: {
options: {
"headerShown": false
}
},
style: { flex: 1, justifyContent: 'center', backgroundColor: "#222222" },
};

const loginScreen = {
name: 'loginScreen',
screen: {
v1: [countText1, loginInput, passwordInput, connexion, fab],
},
onStart:({ route, setUi, getUi })=>{
NetInfo.fetch().then(state => {
if( state.isConnected == true ){}
else{
Alert.alert("Error:: network connection failed, Check your connection.");
}

    });

},
onEnd:({ route, setUi, getUi })=>{

},
screenProps: {
options: {
"headerShown": false
}
},
style: { flex: 1, justifyContent: 'center' },
};

/**
*

  • App generation

*/

const App = () => {
return <RNNano screens={[
splashScreen,
loginScreen
]} />;
};
export default App;

Question

Hi have you implemented a scrollview i would like create a form and this form is scrollable how can i use a scrollview ?

Question

Hi about this framework and react native they have a difference in performance or not ?

probleme node module

Hi when i create a new project with this command

npx rn-nano init MyFirstNanoProject

I have this issue :

BUNDLE ./index.js

error: SyntaxError: C:\Users\Mega-PC\Desktop\nano\MyFirst\App\index.js: Unexpected token, expected "," (7:4)

5 | const countText = {
6 | name:"text"

7 | component: NANO.TEXT,
| ^
8 | value: 1,
9 | props: {
10 | style: {

this is my App/index.js

import { NANO } from 'react-native-nano';

// creating a text component to display numbers starting from 1.
const countText = {
name:"text"
component: NANO.TEXT,
value: 1,
props: {
style: {
fontSize: 50,
alignSelf: 'center',
justifyContent: 'center',
}
}
};

// creating a button component to click and increase number.
const increaseCountButton = {
component: NANO.BUTTON,
value: 'CLICK ME TO INCREASE',
onPress: ({setUi, getUi}) => {

        // increase count by 1
        const textObj = getUi("text")
        textObj.value = textObj.value + 1
        setUi("text", textObj)
        
}

};

// Finally adding both components to screen with v1(vertical) tag.
const screen = {
name: 'WelcomeScreen',
screen: {
v1: [countText, increaseCountButton],
},
style: { flex: 1, justifyContent: 'center' },
};

const App = () => {
return ;
};
export default App;

Error

Hello, i have update react-native nano to the last version and add react-native reanimated but i have this error now

image

Question

hello, once again congratulations for this great framework making it easier to work with react native.

I have a question, for the build of the application in release mode is it the same as react native? I mean for generating the aab file it's the same procedure as react native standard, isn't anything changing?

Informations about this framework

Hi i have a question this framework is a static framework or a dynamic framework i mean can i use the animation in every view or not yet implemented ?
thank you a lot

flatlist

hi our example about flat list and list view doesn't work
each child in the list should have a unique key this is a message how can i add this in your flat list or listview solution

and how can i add a view(text and image and button) in every item
thank you

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.