不变违规:查找未找到名称div的配置

时间:2018-02-24 17:33:49

标签: reactjs react-native radio-button

错误:

error message

当我尝试在我的Android设备上的snak.expo.io和expo客户端上使用已安装的radioButton软件包时出现此错误。我在网上搜索了解决方案,但无济于事。

App.js

 Select table.* From table
Inner Join
(Select id, max(timestamp) as tm from table group by id) as m
On m.tm = table.timestamp and m.id = table.id

UCI.js

import React from 'react';
import {
  StyleSheet,
  Text,
  View,
  TouchableOpacity,
  AppRegistry,
  StatusBar,
} from 'react-native';
import { StackNavigator } from 'react-navigation'; // 1.0.0-beta.23
import UCI from './screens/UCI';


class App extends React.Component {
  static navigationOptions = {
    header: null,
  };

  render() {
    return (
      <View style={styles.container}>
        <StatusBar hidden={true} />
        <View style={styles.boxContainer}>
          <View style={[styles.boxContainer, styles.boxOne]}>
            <Text style={styles.paragraph}>Adinkra</Text>
          </View>

          <View style={styles.boxContainerToggle}>
            <TouchableOpacity
              style={[styles.boxContainer, styles.boxThree]}
              onPress={() => this.props.navigation.navigate('UCI')}>
              <Text style={styles.paragraph}>BEGIN</Text>
            </TouchableOpacity>
          </View>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'column',
  },
  boxContainer: {
    flex: 1, // 1:3
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'white',
  },

  boxContainerToggle: {
    flex: 1,
    flexDirection: 'row',
    padding: 20,
  },
  boxOne: {
    flex: 6, // 5:6
    justifyContent: 'space-around',
    alignItems: 'center',
  },
  boxThree: {
    flex: 1, // 1:6
    flexDirection: 'row',
    backgroundColor: 'skyblue',
    width: '50%',
    height: '100%',
  },

  paragraph: {
    margin: 24,
    fontSize: 27,
    fontWeight: 'bold',
    textAlign: 'center',
    color: '#34495e',
  },
});

const appScreens = StackNavigator({
  Index: { screen: App },
  UCI: { screen: UCI },
});

AppRegistry.registerComponent('Adinkra', () => appScreens);
export default appScreens;

1 个答案:

答案 0 :(得分:2)

react-radio-buttons在内部使用div,因此您不能将其用于React Native。

查看来源:https://github.com/fedosejev/radio-buttons-react/blob/master/source/js/components/Application.jsx