How to use the string function from prop-types

Find comprehensive JavaScript prop-types.string code examples handpicked from public code repositorys.

269
270
271
272
273
274
275
276
277
278
var stylePropTypes = function stylePropTypes(name) {
  var _ref;
  return _ref = {}, _ref[name ? name + "ClassName" : 'className'] = propTypes.oneOfType([propTypes.string, propTypes.func]), _ref;
};
var menuPropTypes = /*#__PURE__*/_extends({
  className: propTypes.string
}, /*#__PURE__*/stylePropTypes('menu'), /*#__PURE__*/stylePropTypes('arrow'), {
  focusProps: propTypes.object,
  menuStyle: propTypes.object,
  arrowStyle: propTypes.object,
fork icon48
star icon883
watch icon6

+ 2 other calls in file

45
46
47
48
49
50
51
52
53
		output: PropTypes.array,
		hasError: PropTypes.bool,
		error: PropTypes.string
	}),
	xdebug: PropTypes.shape({
		status: PropTypes.string
	}),
	container: PropTypes.func.isRequired
};
fork icon7
star icon42
watch icon4

618
619
620
621
622
623
624
625
626
627
628
629
		}
	})
}


createCategoriesPagesDirectors.propTypes = {
	categoriesPath: PropTypes.string.isRequired,
	parentCrumbs: PropTypes.object
}


/**
fork icon3
star icon12
watch icon3

+ 14 other calls in file

4
5
6
7
8
9
10
11
12
13
module.exports = class Link extends React.PureComponent {
  static propTypes = {
    to: PropTypes.oneOfType([
      PropTypes.string.isRequired,
      PropTypes.shape({
        name: PropTypes.string.isRequired,
        params: PropTypes.object,
      }).isRequired,
    ]).isRequired,
  };
fork icon1
star icon2
watch icon2

+ 9 other calls in file

1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
  });
  App.propTypes = {
    packageName: PropTypes.string.isRequired,
    packageVersion: PropTypes.string.isRequired,
    availableVersions: PropTypes.arrayOf(PropTypes.string),
    filename: PropTypes.string.isRequired,
    target: targetType.isRequired
  };
}

fork icon0
star icon1
watch icon0

+ 10 other calls in file

850
851
852
853
854
855
856
857
858
859
860


if (process.env.NODE_ENV !== 'production') {
  FileViewer.propTypes = {
    path: PropTypes.string.isRequired,
    details: PropTypes.shape({
      contentType: PropTypes.string.isRequired,
      highlights: PropTypes.arrayOf(PropTypes.string),
      // code
      uri: PropTypes.string,
      // images
fork icon0
star icon1
watch icon0

+ 10 other calls in file

225
226
227
228
229
230
231
232
233
234
  separator: _propTypes.string,
  filename: _propTypes.string,
  uFEFF: _propTypes.bool,
  onClick: _propTypes.func,
  asyncOnClick: _propTypes.bool,
  enclosingCharacter: _propTypes.string
};

var defaultProps = exports.defaultProps = {
  separator: ',',
fork icon261
star icon0
watch icon18

4
5
6
7
8
9
10
11
12
13
const createMiddleware = require('./middleware');
const { MemoryStrategy } = require('./strategies');

const ShopifyConfigTypes = {
  apiKey: PropTypes.string.isRequired,
  host: PropTypes.string.isRequired,
  secret: PropTypes.string.isRequired,
  scope: PropTypes.arrayOf(PropTypes.string).isRequired,
  afterAuth: PropTypes.func.isRequired,
  shopStore: PropTypes.object,
fork icon87
star icon0
watch icon1

+ 5 other calls in file

49
50
51
52
53
54
55
56
57
58
    required: PropTypes.bool
  }))
})

const configPropTypes = {
  logo: PropTypes.string.isRequired,
  repo: PropTypes.string.isRequired,
  title: PropTypes.string.isRequired,
  similarIssueCount: PropTypes.number,
  readme: stringType,
fork icon0
star icon4
watch icon2

+ 11 other calls in file

73
74
75
76
77
78
79
80
81
82
    );
  }
}

Button.contextTypes = {
  color: PropTypes.string
};

class Message extends React.Component {
  render() {
fork icon553
star icon0
watch icon3

+ 5 other calls in file

72
73
74
75
76
77
78
79
80
81
        posterShape: PropTypes.string
    })),
    itemComponent: PropTypes.elementType,
    deepLinks: PropTypes.shape({
        discover: PropTypes.string,
        library: PropTypes.string
    })
};

module.exports = MetaRow;
fork icon129
star icon506
watch icon31

+ 7 other calls in file

15
16
17
18
19
20
21
22
23
24
25
  }
}


DateTime.propTypes = {
  value: PropTypes.instanceOf(Date),
  timeZone: PropTypes.string
};


export default DateTime;
fork icon0
star icon1
watch icon0

66
67
68
69
70
71
72
73
74
75
  styleSheet: PropTypes.objectOf(CustomPropTypes.style),
  checked: PropTypes.bool,
  onChange: PropTypes.func,
  id: PropTypes.string.isRequired,
  name: PropTypes.string.isRequired,
  value: PropTypes.string.isRequired,
  label: PropTypes.node,
  nonsensitive: PropTypes.bool
}

fork icon0
star icon0
watch icon0

+ 2 other calls in file

1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109


MetaTagger.propTypes = {
  title: PropTypes.string.isRequired,
  description: PropTypes.string.isRequired,
  pathname: PropTypes.string.isRequired,
  site: PropTypes.string.isRequired,
  subsite: PropTypes.string,
  contentType: PropTypes.string,
  imageUrl: PropTypes.string,
  imageUrlThumbnail: PropTypes.string,
fork icon0
star icon0
watch icon0

+ 33 other calls in file

33
34
35
36
37
38
39
40
41
42
43
  render() {
    return <span>{this.props.prop}</span>;
  }
};
RequiredPropComponent.displayName = 'RequiredPropComponent';
RequiredPropComponent.propTypes = {prop: PropTypes.string.isRequired};


it('works', () => {
  const container = document.createElement('div');
  ReactDOM.render(<h1>hello</h1>, container);
fork icon0
star icon0
watch icon0

209
210
211
212
213
214
215
216
217
218
219
    )
  }
}


MSWordContainer.propTypes = {
  title: PropTypes.string
}


module.exports = MSWordContainer
fork icon0
star icon0
watch icon2

+ 2 other calls in file

189
190
191
192
193
194
195
196


TableControls.propTypes =
  { createButton: PropTypes.bool.isRequired
  , perspective: PropTypes.shape( SerialisedPerspective ).isRequired
  // This is the row that is selected in the table, possibly none.
  , selectedroleinstance: PropTypes.string
  };
fork icon0
star icon0
watch icon1

+ 2 other calls in file

244
245
246
247
248
249
250
251
252
253
254


PerspectiveBasedForm.propTypes =
  { perspective: PropTypes.shape( SerialisedPerspective ).isRequired
  , roleinstance: PropTypes.string
  , myroletype: PropTypes.string.isRequired
  , contextinstance: PropTypes.string.isRequired
  , behaviours: PropTypes.arrayOf(PropTypes.func)
  , cardtitle: PropTypes.string.isRequired
  };

fork icon0
star icon0
watch icon1

+ 26 other calls in file

193
194
195
196
197
198
199
200
201
202


TablePasteRole.propTypes = 
  { systemexternalrole: PropTypes.string.isRequired 
  , contextinstance: PropTypes.string.isRequired
  , contexttype: PropTypes.string.isRequired
  , roletype: PropTypes.string.isRequired
  , selectedroleinstance: PropTypes.string
  , myroletype: PropTypes.string.isRequired
  };
fork icon0
star icon0
watch icon1

+ 17 other calls in file

340
341
342
343
344
345
346
347
348
  // PSContext.
  // Can also be a qualified name.
  rol: PropTypes.string.isRequired
  // fully qualified name: the type of Context to create.
  // The core loads the model that defines this type, if it is not locally available.
, contexttocreate: PropTypes.string
// When a perspective is provided, the RoleInstances does not retrieve information from the core itself.
, perspective: PropTypes.object
};
fork icon0
star icon0
watch icon1

+ 5 other calls in file