Skip to content

Instantly share code, notes, and snippets.

@shaharyar123
Created April 6, 2022 08:45
Show Gist options
  • Save shaharyar123/1a73d91ca4e34e5d13d52a306fe2dfc6 to your computer and use it in GitHub Desktop.
Save shaharyar123/1a73d91ca4e34e5d13d52a306fe2dfc6 to your computer and use it in GitHub Desktop.
const MyPage = (props) => {
return (
<div>
<div id="title">My Test Page</div>
{data.map((component, i) => {
<>
<h3> : {component.heading} </h3>
<div key={i}>
<MyComponent component={component} />
</div>
</>;
})}
</div>
);
};
export const getServerSideProps = async () => {
const data = getData(); //call some api or get from static file, etc
return { props: { data } };
};
export default MyPage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment