Migrating from v1.x to v2.x

FrintJS v2.x doesn't have any breaking API changes itself, but React related packages have upgraded themselves to use latest React v15+.

frint-react

The React packages now need to be installed manually.

Before

$ npm install --save frint frint-react

After

$ npm install --save react react-dom prop-types frint frint-react

PropTypes

Before

In React v0.14:

import { PropTypes } from 'react';

After

In React v15+:

import PropTypes from 'prop-types';

Components

Components cannot be created with React.createClass any more. Use ES6 classes instead:

Before

In React v0.14:

import React from 'react';

const MyComponent = React.createClass({
  render() {
    return <p>Hello World</p>;
  }
});

After

In React v15+:

import React from 'react';

class MyComponent extends React.Component {
  render() {
    return <p>Hello World</p>;
  }
}

If your component does not need any lifecycle callbacks, better write them as stateless components instead:

import React from 'react';

function MyComponent(props) {
  return <p>Hello World</p>;
}