1.0.11 • Published 5 years ago

@reaktivo/spy-on-prop-types v1.0.11

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

spy-on-prop-types

GitHub license npm version Coverage Status CircleCI Status

spy-on-prop-types is a small library that allows you to spy on your propTypes definitions.

Installation

npm install @reaktivo/spy-on-prop-types

Usage

You should first start by registering the library so it can spy on your propTypes definitions

import "spy-on-prop-types/register";

After that, you will be able to access your propTypes passed arguments by accessing the definition and the required property of a propType.

MyComponent.propTypes = {
  options: PropTypes.oneOf(["a", "b", "c"]).isRequired
};

console.log(MyComponent.propTypes.options);

/*
{
  definition: ["a", "b", "c"],
  required: true,
  type: 'oneOf',
}
*/

License

spy-on-prop-types is open source software licensed as MIT.

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago