{"size": 612, "ext": "js", "max_stars_repo_path": "src/containers/Categories/index.js", "max_stars_repo_name": "Meyllos/ecoapp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/containers/Categories/index.js", "max_issues_repo_name": "Meyllos/ecoapp", "max_issues_repo_issues_event_min_datetime": "2021-05-08T09:34:16.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T00:56:18.000Z", "max_forks_repo_path": "src/containers/Categories/index.js", "max_forks_repo_name": "Meyllos/ecoapp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 32.2105263158, "max_line_length": 77, "alphanum_fraction": 0.7222222222}
import React, {useEffect} from 'react';
import {useSelector, useDispatch} from 'react-redux';
import {withNavigation} from 'react-navigation';
import Categories from '../../components/Categories';
import {getCategories} from '../../redux/actions/categories';

export const CategoriesContainer = () => {
  const dispatch = useDispatch();
  const {allCategories, loading} = useSelector(({categories}) => categories);

  useEffect(() => {
    dispatch(getCategories());
  }, [dispatch]);

  return <Categories loading={loading} categories={allCategories} />;
};

export default withNavigation(CategoriesContainer);
