react-native warning in chrome debug tools and can't use react dev-tools
世界只因有你
世界只因有你 2017-07-03 11:42:25
0
2
1046

1. I use react@16.0.0-alpha.12, react-native@0.45.1 , which can be used normally in simulation, but in the chrome debugging tool A warning appeared in:

ExceptionsManager.js:71 Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead. (https://fb.me/migrating-from-react-proptypes)
ExceptionsManager.js:71 Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)

And cannot use react dev-tools for debugging

  1. My code:

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

import React, { Component } from 'react'
import {
  AppRegistry,
  View,
  Text,
  StyleSheet
} from 'react-native'
export default class second extends Component{
  render () {
    return (
      <View style={{
         flex: 1,
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'ghostwhite'
      }}>
        <Text style={{fontSize: 28, color: 'cadetblue'}}>class extends</Text>
      </View>
    )
  }
  componentDidMount () {
    console.log('==========')
    this.testConsolelog()
  }
  testConsolelog () {
    console.log('e3423423432')
  }
}

const styles2 = StyleSheet.create({
  bigblue: {
    color: 'blue',
    fontWeight: 'bold',
    fontSize: 30,
  },
  red: {
    color: 'red',
  },
});
AppRegistry.registerComponent('second', () => second);
世界只因有你
世界只因有你

reply all(2)
过去多啦不再A梦

In the react16 you are using, the method React.createClass has been deprecated.

So the react16 version cannot create components through this method. You must use the ES6 way to create components.

class Test extends React.Component {
    ...
}

If you use mixins in your code and must use createClass, you need to introduce another tool library separately.

var createReactClass = require('create-react-class');

In addition, React.propTypes can no longer be used. If you want to detect props, a separate tool needs to be introduced in react16.

import PropTypes from 'prop-types';
習慣沉默

You can’t use react dev-tools, is it because you don’t have check the box to allow access to file addresses

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template