Topics covered will include ...
Why Next.jsNext.js is an open source React + Node based framework that provides you with tools for building optimized websites / apps with server-side rendering (SSR), routing & data fetching.
The Next.js framework also offers HTTP caching, linting and standardisation, SEO tools, and automatic code-splitting via dynamic imports or webpack bundles.
As mentioned, we'll be using Next.js for building this.
For Next.js to work, we need to have Node.js and npm installed.
So, first, install Node.js if you haven't yet.
You can follow the following guides to install Node.js. If you want to use yarn, install it using npm ...npm install --global yarn
npx create-next-app@latest --typescript
Need to install the latest following packages: create-next-app@latest
Ok to proceed? (y)
What is your project named?
Answer: nextjs-react-base
npm run dev
and then view & browse your new Next.js project at http://localhost:3000
npm start
nextjs-react-base/components/authentication/login-form.tsx
import LoginForm from '../components/authentication/login-form';
<section>
<LoginForm> </LoginForm>
</section>
<input value={form.name} onChange={onChange} className="form-control" id="name" name="name" placeholder="Your username ..." type="text" autoComplete="false" />`
const click = (event: any) => {
setLoading(true);
const result = postFormJsonData(formState);
processApiData(result);
setLoading(false);
}