You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Include CI for master branch and PR's
In accordance with facebook#19,
includes config for TravisCI to run test reports on the master branch
and PR's to the master branch.
- Includes .travis.yml config file
- Includes current CI status badge in README
Closesfacebook#19.
* Point readme to correct docs for production builds (facebook#153)
After an update to the docs, the production build was pointing to an outdated link. This commit directs the link to the appropriate location in the React docs.
* 15.6.1
* Add 15.6.1 to CHANGELOG
* Updated vars with consts and lets in PropTypesProductionReact15-test.js
* Updated vars to consts and lets in PropTypesDevelopmentReact15.js
* Updated vars to consts and lets in PropTypesDevelopmentStandalone-test.js
* Updated vars to consts and lets in PropTypesProductionStandalone-test.js
* Add example for `PropTypes.exact`
* Show that shapes can have required properties
* Move explanation of `isRequired` and show it in `PropTypes.shape`
* Remove trailing spaces
* Remove fbjs dependency
* Preserve "Invariant Violation" name
* 15.6.2
* .com
* Add support for objects with a null prototype in objectOf
* Replace `hasOwnProperty` with the more robust "has" package
* Revert "Replace `hasOwnProperty` with the more robust "has" package"
This reverts commit e6a9b28.
* Inline the `has` module
* missed semicolon
* [Tests] use componentName in getPropTypeWarningMessage instead of hard-coded testComponent
* [Fix] Fix `oneOf` when used with Symbols
- Fixes error due to an attempt to coerce a Symbol to a string
- Improves formatting of the "expected" portion of the generated
warning, outputting for example `["Symbol(A)","Symbol(B)"]` rather
than `[null,null]`
Fixesfacebook#10
* Completely remove envify in favor of loose-envify
Closesfacebook#203.
* [New] Add `.elementType`
* Add license to readme
* [Fix] Support validation when hasOwnProperty is not in prototype
Closesfacebook#183; relates to facebook#112.
* [Docs] fix relative release date to be absolute
* [Docs] Fix typo in example
* [New] add `PropTypes.resetWarningCache`
* [dev deps] update `loose-envify`
* `oneOf`: improve warning when multiple arguments are supplied
Adds a different warning message for multiple arguments supplied to oneOf. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]) and this should help developers identifying the error.
* [changelog] update repo links
* v15.7.0
* [Fix] avoid template literal syntax
Fixesfacebook#255. Fixesfacebook#254.
* v15.7.1
* [Tests] add `eslint`; run more travis tests
* [Tests] run tests with multiple react versions
* [Fix] move `loose-envify` back to production deps, for browerify usage
Fixesfacebook#203
* [Tests] add additional passing tests
* [Fix] ensure nullish values in `oneOf` do not crash
Fixesfacebook#256.
* [dev deps] update `browserify`
* v15.7.2
* [Docs] Improve wording for `checkPropTypes`
* [Docs] `PropTypes.node`: add link to react docs
Fixesfacebook#154.
* [meta] use `in-publish` to avoid running the build on install
* `checkPropTypes`: Friendlier message when using a type checker that is not a function
* [Tests] test the build process
* [New] Add type check for validator for 'shape' and 'exact'
Fixesfacebook#220.
* [Tests] fix broken tests
* [Refactor] extract `has`
* [Docs] Add instructions for intentional inclusion of validation in production.
* [New] `oneOfType`: Add expected types to warning
Adds data object to returned error in checker so that the expected types can be accessed from within oneOfType check. Also, updates the tests slightly.
Fixesfacebook#9.
* [Tests] Fixed typo: 'Any type *should* accept any value'
* [Dev Deps] update `eslint`
* [Deps] update `react-is`
* [Dev Deps] update `browserify`, `bundle-collapser`, `react`, `uglifyify`, `uglifyjs`
* [Docs] Typo fix in example
Reverts an incorrect typo fix made in facebook#248.
Closesfacebook#299
* [Tests] Fix spelling
* doc: highlighted the func name (facebook#321)
* [readme] Clarify usage of `elementType`
Closesfacebook#334.
* [Dev Deps] update `bundle-collapser`, `eslint`, `in-publish`, `react`
* [Deps] update `react-is`
* Add a package `sideEffects` field.
* Bump sshpk from 1.13.1 to 1.16.1
Bumps [sshpk](https://github.com/joyent/node-sshpk) from 1.13.1 to 1.16.1.
- [Release notes](https://github.com/joyent/node-sshpk/releases)
- [Commits](TritonDataCenter/node-sshpk@v1.13.1...v1.16.1)
Signed-off-by: dependabot[bot] <[email protected]>
* Use GH Actions
This migrates to a more accessible platform
* [eslint] enable some rules
Additional ESLint rules: "no-multi-spaces": ["error"], "key-spacing": ["error"]
"no-multi-spaces" - Disallow multiple spaces;
"key-spacing" - Enforce consistent spacing between keys and values in object literal properties;
* Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)
---
updated-dependencies:
- dependency-name: path-parse
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
* Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)
---
updated-dependencies:
- dependency-name: tmpl
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
* [deps] regenerate yarn.lock
* [readme] Fix branch name (master -> main)
* [Dev Deps] update `eslint`
* [New] add `PropTypes.bigint`
Closesfacebook#355
* v15.8.0
* [Tests] do not fail fast; add react 17
* [meta] Fix formatting in CHANGELOG.md
* [Tests] convert normal `it` functions to arrow functions
* [Tests] add missing test coverage
* [Fix] fix crash when a custom propType return lacks `.data`; call `hasOwnProperty` properly
Fixesfacebook#369
* [Dev Deps] update `eslint`
* v15.8.1
* docs: add GH button in support of Ukraine (facebook#375)
## Summary
Our mission at Meta Open Source is to empower communities through open source, and we believe that it means building a welcoming and safe environment for all. As a part of this work, we are adding this banner in support for Ukraine during this crisis.
* [Deps] `yarn upgrade`
* build: harden ci.yml permissions
Signed-off-by: Alex <[email protected]>
* Bump semver from 5.7.1 to 5.7.2
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)
---
updated-dependencies:
- dependency-name: semver
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
* Bump ua-parser-js from 0.7.32 to 0.7.33
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.32 to 0.7.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](faisalman/ua-parser-js@0.7.32...0.7.33)
---
updated-dependencies:
- dependency-name: ua-parser-js
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <[email protected]>
* remove production env tests as we do not have any production env tests
* update
---------
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Alex <[email protected]>
Co-authored-by: Joe Fraley <[email protected]>
Co-authored-by: Quinn Stearns <[email protected]>
Co-authored-by: Brandon Dail <[email protected]>
Co-authored-by: Brandon Dail <[email protected]>
Co-authored-by: Barry <[email protected]>
Co-authored-by: Christian Paul <[email protected]>
Co-authored-by: Dan Abramov <[email protected]>
Co-authored-by: Julien Mourer <[email protected]>
Co-authored-by: ksmolniy <[email protected]>
Co-authored-by: C. T. Lin <[email protected]>
Co-authored-by: Jim Fitzpatrick <[email protected]>
Co-authored-by: Augustin Trancart <[email protected]>
Co-authored-by: Benoit Tremblay <[email protected]>
Co-authored-by: Dominik Ferber <[email protected]>
Co-authored-by: Joseph A. Szczesniak <[email protected]>
Co-authored-by: Troy Rhinehart <[email protected]>
Co-authored-by: Patrick Way <[email protected]>
Co-authored-by: Jordan Harband <[email protected]>
Co-authored-by: Wojciech Maj <[email protected]>
Co-authored-by: NoScripter <[email protected]>
Co-authored-by: Gregory Desfour <[email protected]>
Co-authored-by: Asbjørn Hegdahl <[email protected]>
Co-authored-by: NoScripter <[email protected]>
Co-authored-by: rgraffbrd <[email protected]>
Co-authored-by: Josh Alling <[email protected]>
Co-authored-by: weiluntong <[email protected]>
Co-authored-by: Conrad Buck <[email protected]>
Co-authored-by: Mark McCann <[email protected]>
Co-authored-by: John Bampton <[email protected]>
Co-authored-by: Haseeb Khan <[email protected]>
Co-authored-by: G Roques <[email protected]>
Co-authored-by: Jayden Seric <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paul O’Shannessy <[email protected]>
Co-authored-by: Konstantin Popov <[email protected]>
Co-authored-by: Dmitry Vinnik <[email protected]>
Co-authored-by: Alex <[email protected]>
*`oneOf`: improve warning when multiple arguments are supplied ([#244](https://github.com/facebook/prop-types/pull/244))
44
+
* Fix `oneOf` when used with Symbols ([#224](https://github.com/facebook/prop-types/pull/224))
45
+
* Avoid relying on `hasOwnProperty` being present on values' prototypes ([#112](https://github.com/facebook/prop-types/pull/112), [#187](https://github.com/facebook/prop-types/pull/187))
* Clean up mistaken runtime dep, swap envify for loose-envify ([#204](https://github.com/facebook/prop-types/pull/204))
48
+
49
+
## 15.6.2
50
+
* Remove the `fbjs` dependency by inlining some helpers from it ([#194](https://github.com/facebook/prop-types/pull/194)))
51
+
52
+
## 15.6.1
53
+
* Fix an issue where outdated BSD license headers were still present in the published bundle [#162](https://github.com/facebook/prop-types/issues/162)
54
+
1
55
## 15.6.0
2
56
3
57
* Switch from BSD + Patents to MIT license
4
-
* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/reactjs/prop-types/pull/41) and [#87](https://github.com/reactjs/prop-types/pull/87))
58
+
* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/facebook/prop-types/pull/41) and [#87](https://github.com/facebook/prop-types/pull/87))
5
59
6
60
## 15.5.10
7
61
8
-
* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/reactjs/prop-types/pull/50))
62
+
* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/facebook/prop-types/pull/50))
9
63
10
64
## 15.5.9
11
65
12
-
* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/reactjs/prop-types/pull/45))
66
+
* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/facebook/prop-types/pull/45))
13
67
14
68
## 15.5.8
15
69
16
-
* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/reactjs/prop-types/pull/26))
70
+
* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/facebook/prop-types/pull/26))
17
71
18
72
## 15.5.7
19
73
20
-
***Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/reactjs/prop-types/pull/20))
21
-
* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/reactjs/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/reactjs/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4))
74
+
***Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/facebook/prop-types/pull/20))
75
+
* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/facebook/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/facebook/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4))
22
76
23
77
## 15.5.6
24
78
25
79
**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
26
80
27
-
* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/reactjs/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a))
81
+
* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/facebook/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a))
28
82
29
83
## 15.5.5
30
84
31
85
**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
32
86
33
-
* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/reactjs/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a))
87
+
* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/facebook/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a))
34
88
35
89
## 15.5.4
36
90
37
91
**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
38
92
39
-
* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/reactjs/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8))
40
-
* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/reactjs/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a))
93
+
* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/facebook/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8))
94
+
* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/facebook/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a))
41
95
* Remove the accidentally included typechecking code from the production build.
42
96
43
97
## 15.5.3
44
98
45
99
**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
46
100
47
-
* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/reactjs/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace))
101
+
* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/facebook/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace))
48
102
49
103
## 15.5.2
50
104
51
105
**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.**
52
106
53
-
* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/reactjs/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d))
107
+
* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/facebook/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d))
54
108
55
109
56
110
## 15.5.1
@@ -67,4 +121,4 @@
67
121
68
122
## Before 15.5.0
69
123
70
-
PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md)
124
+
PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/HEAD/CHANGELOG.md)
// You can chain any of the above with `isRequired` to make sure a warning
113
+
// is shown if the prop isn't provided.
114
+
105
115
// An object taking on a particular shape
106
116
optionalObjectWithShape:PropTypes.shape({
107
-
color:PropTypes.string,
108
-
fontSize:PropTypes.number
117
+
optionalProperty:PropTypes.string,
118
+
requiredProperty:PropTypes.number.isRequired
119
+
}),
120
+
121
+
// An object with warnings on extra properties
122
+
optionalObjectWithStrictShape:PropTypes.exact({
123
+
optionalProperty:PropTypes.string,
124
+
requiredProperty:PropTypes.number.isRequired
109
125
}),
110
126
111
-
// You can chain any of the above with `isRequired` to make sure a warning
112
-
// is shown if the prop isn't provided.
113
127
requiredFunc:PropTypes.func.isRequired,
114
128
115
129
// A value of any data type
@@ -160,18 +174,18 @@ For example:
160
174
161
175
```js
162
176
"dependencies": {
163
-
"prop-types":"^15.5.7"
177
+
"prop-types":"^15.5.7"
164
178
}
165
179
```
166
180
167
181
For libraries, we *also* recommend leaving it in `dependencies`:
168
182
169
183
```js
170
184
"dependencies": {
171
-
"prop-types":"^15.5.7"
185
+
"prop-types":"^15.5.7"
172
186
},
173
187
"peerDependencies": {
174
-
"react":"^15.5.0"
188
+
"react":"^15.5.0"
175
189
}
176
190
```
177
191
@@ -185,7 +199,7 @@ For UMD bundles of your components, make sure you **don’t** include `PropTypes
185
199
186
200
### React 0.14
187
201
188
-
This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released a year ago), there are no other changes in 0.14.9, so it should be a painless upgrade.
202
+
This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade.
189
203
190
204
```shell
191
205
# ATTENTION: Only run this if you still use React 0.14!
**If you DO want to use validation in production**, you can choose to use the **development version** by importing/requiring `prop-types/prop-types` instead of `prop-types`.
264
+
249
265
**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case.
250
266
251
-
If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://facebook.github.io/react/docs/installation.html#development-and-production-versions) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users.
267
+
If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users.
// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to
277
293
// `MyComponent`, expected `number`.
278
294
```
295
+
296
+
## PropTypes.resetWarningCache()
297
+
298
+
`PropTypes.checkPropTypes(...)` only `console.error`s a given message once. To reset the error warning cache in tests, call `PropTypes.resetWarningCache()`
0 commit comments