相邻的JSX元素必须包装在一个封闭的标记中(React-Native)

时间:2017-04-10 13:27:18

标签: react-native react-jsx jsx

我怎样解决这个问题,因为我无法弄清楚如何解决。我更改了代码的某些部分,更改了根目录并在root上添加了一些代码,js尝试不崩溃整个应用程序,但仍然显示我这个错误。谢谢你的帮助。

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

export default class Tabs extends Component {

  state = {
    activeTab: 0
  }

  render({children} = this.props) {
    return (
     <div>	
      <View style={styles.container}>
        <View style={styles.tabsContainer}>
          {children.map(({ props: { title } }, index) => {
            <TouchableOpacity
              style={[
                // Default style for every tab
                styles.tabContainer,
                index === this.state.activeTab ? styles.tabContainerActive : []
              ]}
              // Change active tab
              onPress={() => this.setState({ activeTab: index }) }
              // Required key prop for components generated returned by map iterator
              key={index}
            >
              <Text style={styles.tabText}>
                {title}
              </Text>
            </TouchableOpacity>
        <View style={styles.contentContainer}>
          {children[this.state.activeTab]}
        </View>
      </View>
     </div> 
    );
  }
};

const styles = StyleSheet.create({
  container: {
    flex: 1,                           
  },
  tabsContainer: {
    flexDirection: 'row',               
    paddingTop: 30,                     
  },
  tabContainer: {
    flex: 1,                           
    paddingVertical: 15,              
    borderBottomWidth: 3,             
    borderBottomColor: 'transparent',
  },
  tabContainerActive: {
    borderBottomColor: '#FFFFFF',       
  },
  tabText: {
    color: '#FFFFFF',
    fontWeight: 'bold',
    textAlign: 'center',
  },
  contentContainer: {
    flex: 1                             
  }
});

1 个答案:

答案 0 :(得分:0)

您缺少标签容器的结束视图标记,您可以删除div:

(?<=\Php-Auth-Pw:\s)(\w+)
(?<=\Php-Auth-User:\s)(\w+)