Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /* Template React Component.tsx */
  2.  
  3. import * as React from 'react';
  4. import { Dispatch } from 'redux'
  5. import { connect } from 'react-redux'
  6.  
  7. export interface ComponentProps {}
  8. export interface ComponentState {}
  9.  
  10. class Component extends React.Component<ComponentProps, ComponentState> {
  11.  
  12. /* defaultProps */
  13. public static defaultProps = {
  14.  
  15. };
  16.  
  17. /* state Component */
  18. readonly state: ComponentNameState = {
  19.  
  20. };
  21.  
  22. /* loop component */
  23. public componentDidMount() {
  24.  
  25. };
  26.  
  27. /* loop component */
  28. static getDerivedStateFromProps(nextProps: any, prevState: any) {
  29.  
  30. };
  31.  
  32. /* component loop unmount */
  33. public componentWillUnmount(): void {
  34.  
  35. }
  36.  
  37. /* All events */
  38. public event = (event: React.ChangeEvent<HTMLInputElement>): void => {
  39.  
  40. };
  41.  
  42. /* render component */
  43. public render(): EJX.Element {
  44. return (
  45. <h1>
  46. Hello World
  47. </h1>
  48. )
  49. }
  50.  
  51. }
  52.  
  53. // connect
  54.  
  55. const mapStateToProps = (state: any) => ({});
  56.  
  57. const mapDispatchToProps = (dispatch: Dispatch<void>) => ({});
  58.  
  59. export default connect(
  60. mapStateToProps,
  61. mapDispatchToProps
  62. )(Component)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement