@@ -18,93 +18,93 @@ NextJS and React Snippets with TypeScript support as well!🚀
1818
1919 ``` jsx
2020 const Component = () => {
21- return < div>< / div>
22- }
23- export default Component
21+ return < div>< / div> ;
22+ };
23+ export default Component ;
2424 ```
2525
2626### TypeScript
2727
28282. ` rafect` (React Functional Component with Types)
2929
3030 ` ` ` tsx
31- import { FC } from ' react'
31+ import { FC } from " react";
3232 interface Props {}
3333 const Component: FC<Props> = () => {
34- return <div></div>
35- }
36- export default Component
34+ return <div></div>;
35+ };
36+ export default Component;
3737 ` ` `
3838
3939## NextJS
4040
4141### JavaScript
4242
43- 1. ` nextssr ` (Get Server Side Props Next . js )
43+ 1. ` nssr ` (Next . js Get Server Side Props Typescript )
4444
4545 ` ` ` jsx
4646 export const getServerSideProps = async (context) => {
4747 return {
4848 props: {},
49- }
50- }
49+ };
50+ };
5151 ` ` `
5252
53- 2. ` nextssg ` (Get Static Props Next . js )
53+ 2. ` nssg ` (Next . js Get Static Props Typescript )
5454
5555 ` ` ` jsx
5656 export const getStaticProps = async (context) => {
5757 return {
5858 props: {},
59- }
60- }
59+ };
60+ };
6161 ` ` `
6262
6363### TypeScript
6464
65- 1. ` nextssrt ` (Get Server Side Props Next . js )
65+ 1. ` nssrt ` (Next . js Get Server Side Props Typescript )
6666
6767 ` ` ` tsx
6868 export const getServerSideProps: GetServerSideProps = async (context) => {
69- return { props: {} }
70- }
69+ return { props: {} };
70+ };
7171 ` ` `
7272
73- 2. ` nextssgt ` (Get Static Props Next . js )
73+ 2. ` nssgt ` (Next . js Get Static Props Typescript )
7474
7575 ` ` ` tsx
7676 export const getStaticProps: getStaticProps = async (context) => {
77- return { props: {} }
78- }
77+ return { props: {} };
78+ };
7979 ` ` `
8080
81- 3. ` nextgip ` (Get Initial Props in Next .js )
81+ 3. ` ngip ` (Get Initial Props in Next .js )
8282
8383 ` ` ` tsx
8484 Page.getInitialProps = async (context) => {
85- return { props: {} }
86- }
85+ return { props: {} };
86+ };
8787 ` ` `
8888
89- 3 ) ` taytay ` (NextPage component with NextPage type )
89+ 3 ) ` npt ` (Next . js Page Typescript )
9090
9191 ` ` ` tsx
92- import type { NextPage } from ' next'
92+ import type { NextPage } from " next";
9393 const Page: NextPage = () => {
94- return <></>
95- }
96- export default Page
94+ return <></>;
95+ };
96+ export default Page;
9797 ` ` `
9898
99- 4 ) ` nextct ` (Next JS Component with NextComponentType and Props )
99+ 4 ) ` nct ` (Next . js Component Typescript )
100100
101101 ` ` ` tsx
102- import type { NextComponentType, NextPageContext } from ' next'
102+ import type { NextComponentType, NextPageContext } from " next";
103103 interface Props {}
104104 const Component: NextComponentType<NextPageContext, {}, Props> = (
105- props: Props,
105+ props: Props
106106 ) => {
107- return <div></div>
108- }
109- export default Component
107+ return <div></div>;
108+ };
109+ export default Component;
110110 ` ` `
0 commit comments