Created
February 9, 2020 05:29
-
-
Save ikr4-m/09d722cf95e9915cc1f5f28f4b1f6ca3 to your computer and use it in GitHub Desktop.
How to make JSDoc for React Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
/** | |
* @typedef Props - Test typedef props | |
* @property {boolean} [mantap] - Mantap ga? | |
* | |
* @typedef State - Test typedef state | |
* @property {number} itung - Angka | |
* | |
* @extends {Component<Props, State>} | |
*/ | |
export default class App extends Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
itung: 0 | |
} | |
} | |
render () { | |
return ( | |
<div className='app'> | |
<h1>Hello world</h1> | |
<h1> | |
{this.props.mantap || 'Mantap bosku'} | |
</h1> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment