Storybook: use proptypes from standalone package

Created on 28 Jul 2017  路  7Comments  路  Source: storybookjs/storybook

storybook-native still uses import React, { Component, PropTypes } from 'react';

which does not work anymore in react 16.0.0.beta.x

it should use package prop-types

react-native dependencies

Most helpful comment

FWIW, I've considered moving glamorous to _just_ use prop-types...

All 7 comments

Given that we don't specify a react dependency version, I'd like to look towards @kentcdodds's solution for this glamorous, https://github.com/paypal/glamorous/commit/14970c1bb59d1408d3066d209dafa356b5ce3173.

Essentially - use prop-types if they exist and React is of a certain version, otherwise use React.PropTypes.

I think the right move is to continue to be flexible with the React version, since as a tool, we don't necessarily want to enforce requirements onto the projects using the tool.

@ajwhite that's true, but i want to highlight that the prop-types package work with react 14, 15 and 16: https://www.npmjs.com/package/prop-types

React.version.slice(0, 4) === '15.5'

Looks like this will warn in 15.6 and break in 16

@ajwhite why complicate things? Shouldn't we just move to prop-types and be done with it?

but i want to highlight that the prop-types package work with react 14, 15 and 16

Given @macrozone's findings -- sounds like we can move over without a problem on the compatibility fronts 馃憤

FWIW, I've considered moving glamorous to _just_ use prop-types...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpersaud picture rpersaud  路  3Comments

tomitrescak picture tomitrescak  路  3Comments

sakulstra picture sakulstra  路  3Comments

levithomason picture levithomason  路  3Comments

purplecones picture purplecones  路  3Comments