View es7.js
import React from 'react';
import { connect } from 'react-redux';
import FormContainer from './container';
@connect(state => ({ openNewFeedback: state.openNewFeedback }))
export default class Form extends React.Component {
static propTypes = {
openNewFeedback: React.PropTypes.bool,
dispatch: React.PropTypes.func,
actions: React.PropTypes.any,
View babel.json
{
"presets": [
"es2015",
"react",
"stage-0"
],
"plugins": [
"transform-decorators-legacy",
[
"resolver",
View withdecorator.js
import React from 'react';
import { connect } from 'react-redux';
@connect((state) => ({
openNewFeedback: state.openNewFeedback,
}))
export default class Form extends React.Component {}
View withoutDecorator.js
import React from 'react';
import { connect } from 'react-redux';
class Form extends React.Component {}
const mapToProps = state => ({ openNewFeedback: state.openNewFeedback });
export default connect(mapToProps, Form);
View fatArrowFunctionEs7.js
class Form extends React.Component {
handleCreate = () => {
const { dispatch, actions } = this.props;
const type = actions.CREATE;
const payload = this.state;
dispatch({ type, payload });
this.handleClose();
}
View propertiesEs7.js
class Form extends React.Component {
static propTypes = {}
state = {};
}
View propertiesEs6.js
class Form extends React.Component {
constructor(props) {
super(props);
this.state = {};
this.handleCreate = this.handleCreate.bind(this);
}
}
Form.propTypes = {}
View es6.js
import React from 'react';
import { connect } from 'react-redux';
import FormContainer from './container';
class Form extends React.Component {
constructor(props) {
super(props);
this.state = {
start: null,
finish: null,
View desafio.md

[https://alf.nu/ReturnTrue]

function reflexive(x) {
    return x != x;
}
reflexive(NaN)

function transitive(x,y,z) {
    return x && x == y && y == z && x != z;