iflow icon indicating copy to clipboard operation
iflow copied to clipboard

iflow can using in React Native?

Open hnyaoqingping opened this issue 7 years ago • 4 comments

hnyaoqingping avatar Feb 04 '18 05:02 hnyaoqingping

Of course, iFlow and React-iFlow can be run in any support ES6+ JavaScript environment, also including react-native. Welcome to use iFlow.

unadlib avatar Feb 04 '18 08:02 unadlib

Thanks!

hnyaoqingping avatar Feb 04 '18 14:02 hnyaoqingping

Proxies are not supported by Android for React native. I get error message: " Can't find variable: Proxy Pipe index.js 746:72 "

hnyaoqingping avatar Feb 04 '18 16:02 hnyaoqingping

Sorry, too late to reply you. I try to build on React Native v0.53.0, it's OK.

Simple code:

react-native init example
cd example && yarn add iflow react-iflow
vi App.js

App.js code:

import React, { Component } from 'react';
import { View, Text, Button } from 'react-native';
import iFlow from 'iflow';
import flow from 'react-iflow';

class App extends Component {
  render() {
    return (
      <View>
        <Button
          onPress={this.props.store.add}
          title="+"
        />
        <Text>
          {this.props.store.counter}
        </Text>
      </View>
    );
  }
}

const store = iFlow({
  counter: 1,
  add(){
    this.counter++ 
  }
}).create()

export default flow(store)(App)

save App.js and run the project. react-native run-ios

It's done, Have a good time, 👍 !

unadlib avatar Feb 19 '18 08:02 unadlib