BVB Source Codes

prettier Show bad_default_props.js Source code

Return Download prettier: download bad_default_props.js Source code - Download prettier Source code - Type:.js
  1. var React = require('React');
  2.  
  3. type T1 = { }
  4. type T2 = { x: number }
  5. type T3 = { x: number, y: number }
  6.  
  7. class C1 extends React.Component<T1, T2, any> { // error
  8. }
  9.  
  10. class C2 extends React.Component<void, T2, any> { // OK
  11. }
  12.  
  13. // no need to add type arguments to React.Component
  14. class C3 extends React.Component { // OK
  15.   static defaultProps: T1;
  16.   props: T2;
  17. }
  18.  
  19. class C4 extends React.Component { // OK, recommended
  20.   // no need to declare defaultProps unless necessary
  21.   props: T2;
  22. }
  23.  
  24. class C5 extends React.Component<T2, T3, any> { // error
  25. }
  26.  
  27. class C6 extends React.Component { // OK, recommended
  28.   static defaultProps: T2;
  29.   props: T3;
  30. }
  31.  
downloadbad_default_props.js Source code - Download prettier Source code
Related Source Codes/Software:
storybook - 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
parse-server - Parse-compatible API server module for Node/Expres... 2017-06-07
inferno - An extremely fast, React-like JavaScript library f... 2017-06-08
guetzli - Perceptual JPEG encoder 2017-06-08
cs-video-courses - List of Computer Science courses with video lectur... 2017-06-08
interviews - Everything you need to know to get the job. 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top