BVB Source Codes

prettier Show classes.js Source code

Return Download prettier: download classes.js Source code - Download prettier Source code - Type:.js
  1. var React = require('React');
  2.  
  3. type DefaultProps = { };
  4. type Props = { x: number };
  5. type State = { y: number };
  6.  
  7. class Foo extends React.Component {
  8.   props: Props;
  9.   state: State;
  10.   static defaultProps: DefaultProps;
  11.  
  12.   is_mounted: boolean;
  13.  
  14.   static bar(): void {}
  15.  
  16.   qux(): void {
  17.     var _: string = this.props.x;
  18.   }
  19.  
  20.   constructor(props) {
  21.     super(props);
  22.     this.state = { y: "" };
  23.   }
  24.  
  25.   setState(o: { y_: string }): void { }
  26.  
  27.   componentDidMount(): void {
  28.     this.is_mounted = true;
  29.   }
  30.  
  31.   componentWillReceiveProps(
  32.     nextProps: Object,
  33.     nextContext: any
  34.   ): void {
  35.     this.qux();
  36.   }
  37.  
  38. }
  39.  
  40. Foo.defaultProps = 0;
  41. var foo: $jsx<number> = <Foo/>;
  42.  
  43. Foo.bar();
  44.  
  45. var FooLegacy = React.createClass({
  46.   is_mounted: (undefined: ?boolean),
  47.  
  48.   propTypes: {
  49.     x: React.PropTypes.number.isRequired
  50.   },
  51.  
  52.   getDefaultProps(): DefaultProps { return {} },
  53.  
  54.   statics: {
  55.     bar(): void {}
  56.   },
  57.  
  58.   qux(): void {
  59.     var _: string = this.props.x;
  60.   },
  61.  
  62.   getInitialState(): { y: string } {
  63.     return { y: "" };
  64.   },
  65.  
  66.   setState(o: { y_: string }): void { },
  67.  
  68.   componentDidMount(): void {
  69.     this.is_mounted = true;
  70.   },
  71.  
  72.   componentWillReceiveProps(
  73.     nextProps: Object,
  74.     nextContext: any
  75.   ): void {
  76.     this.qux();
  77.   },
  78. });
  79.  
  80. FooLegacy.defaultProps = 0;
  81. var foo_legacy: $jsx<number> = <FooLegacy/>;
  82.  
  83. FooLegacy.bar();
  84.  
downloadclasses.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