Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Template React Component.tsx */
- import * as React from 'react';
- import { Dispatch } from 'redux'
- import { connect } from 'react-redux'
- export interface ComponentProps {}
- export interface ComponentState {}
- class Component extends React.Component<ComponentProps, ComponentState> {
- /* defaultProps */
- public static defaultProps = {
- };
- /* state Component */
- readonly state: ComponentNameState = {
- };
- /* loop component */
- public componentDidMount() {
- };
- /* loop component */
- static getDerivedStateFromProps(nextProps: any, prevState: any) {
- };
- /* component loop unmount */
- public componentWillUnmount(): void {
- }
- /* All events */
- public event = (event: React.ChangeEvent<HTMLInputElement>): void => {
- };
- /* render component */
- public render(): EJX.Element {
- return (
- <h1>
- Hello World
- </h1>
- )
- }
- }
- // connect
- const mapStateToProps = (state: any) => ({});
- const mapDispatchToProps = (dispatch: Dispatch<void>) => ({});
- export default connect(
- mapStateToProps,
- mapDispatchToProps
- )(Component)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement