I tried to include getStaticProps + getInitialProps simultaneously but nextjs does not allow this.
Why i need this?
because an api data fetch needs to be done just once at build-time and be shared after that. This api returns a json file that will be used to create menu categories. Now I have created a json file and after analyzing bundles i saw that each page of my application has this json file and the size of common chunk had increased. How can i solve this problem? what is the best pattern to implement menu category header with lots of categories?