import React from 'react' ; import type { NextPage } from 'next' ; import { GetStaticProps } from 'next' ; import PortfolioLayout from '../../components/Portfolio/PortfolioLayout/PortfolioLayout' ; import { wrapper } from '../../store' ; import { bindActionCreators , Dispatch } from 'redux' ; import { loadLatestArticles } from '../../store/action-creators/articles-action-creators' ; import { connect } from 'react-redux' ; import AllDevToArticles from '../../components/Portfolio/AllDevToArticles/AllDevToArticles' ; interface ServerProps { title : string ; } important function param { string } title returns { JSX . Element } const ArticlesPage = ( { title } ) => { return ( < PortfolioLayout title = { title } > < AllDevToArticles /> < /PortfolioLayout>); } ; export const getStaticProps = wrapper . getStaticProps ( ( store ) => async ( ) => { await store . dispatch ( loadLatestArticles ( ) ) ; return { props : { title : 'Vova Ushenko | Articles' , } , revalidate : 3600 , } ; } ) ; const mapDispatchToProps = ( dispatch ) => { return { news : bindActionCreators ( loadLatestArticles , dispatch ) , } ; } ; export default connect ( null , mapDispatchToProps ) ( ArticlesPage ) ;