Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { connect } from 'react-redux';
- import State from '@state';
- import { sendGetRequest } from '~/redux/systemActions/common';
- interface IDefaultProps {
- title: string;
- test: string;
- }
- interface IProps extends Partial<IDefaultProps> {
- users: any;
- }
- class ClassWithDispatch extends React.PureComponent<IProps> {
- static defaultProps: IDefaultProps = {
- title: 'title',
- test: '123',
- };
- constructor(props: IProps) {
- super(props);
- }
- componentDidMount(): void {
- const { dispatch } = this.props;
- dispatch(sendGetRequest({
- url: '/test/api/url',
- data: [],
- }));
- }
- render() {
- const { users } = this.props;
- return (
- <div>
- Temp file
- </div>
- );
- }
- }
- const mapStateToProps = (state: State) => ({
- users: state.users,
- });
- export default connect(mapStateToProps)(ClassWithDispatch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement