Props(属性)

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';



class Greeting extends Component {
  render() {
    return (
      hello, {this.props.name}
    );
  }
}

export default class DTest extends Component {
  render() {
    return (
      
        
        
        
      
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});

AppRegistry.registerComponent('DTest', () => DTest);

Props(属性)_第1张图片
效果图

你可能感兴趣的:(Props(属性))