Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
use exact instead of shape
Browse files Browse the repository at this point in the history
`shape` doesn’t raise exceptions if an invalid key was supplied, but
`exact` does.
  • Loading branch information
chriddyp committed Apr 15, 2019
1 parent d0b0f5d commit 370c5ea
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Checklist.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Checklist.propTypes = {
* An array of options
*/
options: PropTypes.arrayOf(
PropTypes.shape({
PropTypes.exact({
/**
* The checkbox's label
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Dropdown.propTypes = {
* An array of options
*/
options: PropTypes.arrayOf(
PropTypes.shape({
PropTypes.exact({
/**
* The dropdown's label
*/
Expand Down
8 changes: 4 additions & 4 deletions src/components/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ const graphPropTypes = {
* `config` is set separately by the `config` property,
* and `frames` is not supported.
*/
figure: PropTypes.shape({
figure: PropTypes.exact({
data: PropTypes.arrayOf(PropTypes.object),
layout: PropTypes.object,
}),
Expand Down Expand Up @@ -371,7 +371,7 @@ const graphPropTypes = {
* See https://plot.ly/javascript/configuration-options/
* for more info.
*/
config: PropTypes.shape({
config: PropTypes.exact({
/**
* No interactivity, for export or image generation
*/
Expand All @@ -391,7 +391,7 @@ const graphPropTypes = {
/**
* A set of editable properties
*/
edits: PropTypes.shape({
edits: PropTypes.exact({
/**
* annotationPosition: the main anchor of the annotation, which is the
* text (if no arrow) or the arrow (which drags the whole thing leaving
Expand Down Expand Up @@ -539,7 +539,7 @@ const graphPropTypes = {
/**
* Modifications to how the toImage modebar button works
*/
toImageButtonOptions: PropTypes.shape({
toImageButtonOptions: PropTypes.exact({
/**
* The file format to create
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/RadioItems.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ RadioItems.propTypes = {
* An array of options
*/
options: PropTypes.arrayOf(
PropTypes.shape({
PropTypes.exact({
/**
* The radio item's label
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/RangeSlider.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ RangeSlider.propTypes = {
marks: PropTypes.objectOf(
PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
PropTypes.exact({
label: PropTypes.string,
style: PropTypes.object,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Slider.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Slider.propTypes = {
marks: PropTypes.objectOf(
PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
PropTypes.exact({
label: PropTypes.string,
style: PropTypes.object,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tabs.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Tabs.propTypes = {
* background: '#f9f9f9'
* }
*/
colors: PropTypes.shape({
colors: PropTypes.exact({
border: PropTypes.string,
primary: PropTypes.string,
background: PropTypes.string,
Expand Down

0 comments on commit 370c5ea

Please sign in to comment.