Giter Site home page Giter Site logo

barajs / bara-react Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 1.67 MB

BaraJS React Binding Module

Home Page: https://react.barajs.dev

License: MIT License

HTML 3.61% CSS 1.97% TypeScript 93.89% JavaScript 0.53%
bara bara-react typescript react-native cross-platform

bara-react's Introduction

bara-react

Build Bara app using React, easily extensible and scalable without any fear of breaking build.

This library belongs to BaraJS Official Library, we build this for the next cross-platforms React app using the architect of reactive functional programming.

By using bara-react, you're no longer need to maintain a wired codebase anymore. Build your apps feature by feature. You can quickly implement new features as your app expands or remove a feature when it's deprecated without touching other area of the project.

Installation

yarn add -E bara bara-react

or using NPM

npm i --save bara bara-react

Usage

In your main index.js:

import {register} from 'bara'
import {useReactApp} from 'bara-react'
import App from './App'
import {useDisplayWelcomeMsgTrigger} from './app-trigger'

const myBaraReactApp = () => {
    useReactApp(App)
    useDisplayWelcomeMsgTrigger()
}

register(myBaraReactApp)

In your React App App.jsx':

import React from 'react'
import {BaraProvider, Text, Touchable, View} from 'bara-react'

export default const App = () => {
    return (
        <BaraProvider>
            <View>
                <Touchable name="welcome-button">
                    <Text>Hello Bara App!</Text>
                </Touchable>
            </View>
        </BaraProvider>
    )
}

Create another file called app-trigger.js:

import { useTouchablePress, nameOf } from 'bara-react'

export const useDisplayWelcomeMsgTrigger = () => {
    return useTouchablePress({nameOf: nameOf('welcome-button')}, () => {
        alert('Welcome Button has been clicked!')
    })
}

Why I have to build my app this way?

  • React is best of rendering.
  • Bara is best of reactive functional programming.
  • Easily create or remove a component without touching other business components.
  • Easily plug and play with BaraJS ecosystem module.
  • It's fun or ... not!

Contribute

Open in Gitpod

License

MIT © BaraJS

bara-react's People

Contributors

nampdn avatar renovate-bot avatar renovate[bot] avatar semantic-release-bot avatar

Watchers

 avatar  avatar

Forkers

lgtm-migrator

bara-react's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @types/react-native Unavailable
npm tslint Unavailable
npm tslint-react Unavailable

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • bara ^2.4.0
  • react-native-web ^0.19.0
  • @semantic-release/changelog 3.0.6
  • @semantic-release/git 7.0.18
  • @types/jest 24.9.1
  • @types/node 11.15.54
  • @types/react 16.14.60
  • @types/react-dom 16.9.24
  • @types/react-native 0.73.0
  • react 16.14.0
  • react-dom 16.14.0
  • react-scripts 2.1.8
  • semantic-release 15.14.0
  • tslint 5.20.1
  • tslint-config-airbnb 5.11.2
  • tslint-config-prettier 1.18.0
  • tslint-react 4.2.0
  • typescript 3.9.10
  • react >=16.8
  • react-dom >=16.8
  • bara >=2.4
travis
.travis.yml

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

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.