Giter VIP home page Giter VIP logo

react-complete-guide-course-resources's Introduction

React - The Complete Guide Course Resources

This repository provides access to code files, code snapshots, slides & other resources that are used or provided by the React - The Complete Guide course.

If you're facing any issues with the code, please post in the course Q&A section.

Repository Content

  • Code Snapshots: All code snapshots (starting snapshots, intermediate snapshots, finished snapshots) for the various course sections can be found in the /code folder.
  • Lecture Attachments: Any standalone code files or other attachments that are mentioned in course lectures (and attached to those lectures) are stored in the /attachments folder.
  • Other Resources: Other resources (like the course slides) can be found in the /other folder.

The Code Snapshots and Lecture Attachments folders contain one subfolder per course section - this allows you to easily access the resources for a specific course section.

How To Use Code Snapshots

Code snapshots are primarily provided to allow you to compare your code to mine. The snapshots are taken directly from the course recordings and therefore reflect my code you see in the videos.

Of course, you can also try running those code snapshots on your machine. You'll need to run npm install in the individual snapshot folders, followed by npm run dev to start the development server - just as shown in the course.

react-complete-guide-course-resources's People

Contributors

maxschwarzmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-complete-guide-course-resources's Issues

Issue

I'm not able to run your code, please help me it's showing there's no package.json file Exists.

Sandbox and local project not working

After installing the local project zip while running the command 'node app.js' there is no response and it stuck there and while using the sandbox also the backend is not running it showing error of bodyparser module not found. (For section - https request)

Unable to clone/Download the entire course. It's throwing error

error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 6422 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Error Running NPM Run Dev

after running npm install, then trying to execute npm run dev, I get the following error in my Mac terminal window:

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:122:18)
at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: vite
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.

Hi, I'm on 22 authentication files, and the authAction signup submit does not work.

This is the video I'm on: https://www.udemy.com/course/react-the-complete-guide-incl-redux/learn/lecture/35734204#overview

First, the action function inside of Authentication.jsx does not get called.

export async function action({ req }) {
  console.log('action req', req);
  const searchParams = new URL(req.url).searchParams;
  console.log('searchParams', searchParams);
  const mode = searchParams.get('mode') || 'login';
  console.log('mode', mode);

  if (mode !== 'login' && mode !== 'signup') {
    throw json({ message: 'Unsupported mode.' }, { status: 422 });
  }

  const data = await req.formData();
  console.log('data', data);
  const authData = {
    email: data.get('email'),
    password: data.get('password'),
  };
  console.log('authData', authData);

  const res = await fetch('http://localhost:8080/' + mode, {
    method: 'POST',
    headers: {
      'Content-Type': 'application;/json',
    },
    body: JSON.stringify(authData),
  });

  if (res.status === 422 || res.status === 401) {
    return res;
    // throw json({ message: 'An error occurred.' }, { status: res.status });
  }

  if (!res.ok) {
    throw json({ message: 'Could not authenticate user.', status: 500 });
  }

  // soon: manage token
  return redirect('/');
}

The was this was written was confusing too, because normally one would expect a onSubmit function that would be inside the actual AuthForm.jsx, and also it seems unsafe to pass the password in the url?

But I am curious how your form was about to work here and actually redirect to / but in my code, the form did nothing, action was never called, but my url got updated like so:

http://localhost:5173/auth?email=test%40etetedsfd.com&password=dsfajksdfjasd


My version of the App routes:

import { createBrowserRouter, RouterProvider } from 'react-router-dom';

import HomePageView from '@/views/Home';
import Postings from '@/views/Postings';
import PostingDetailsPage from '@/components/postings/PostingDetailsPage';
import Workforce from '@/views/Workforce';
import Reports from '@/views/Reports';
import Enterprise from '@/views/Enterprise';
import AppLayout from '@/views/AppLayout';
import ErrorPage from '@/views/ErrorPage';
import AuthenticationPage, {
  action as authAction,
} from '@/views/Authentication';

const router = createBrowserRouter([
  {
    path: '/',
    element: <HomePageView />,
    errorElement: <ErrorPage />,
  },
  {
    path: '/auth',
    element: <AuthenticationPage />,
    action: authAction,
  },
  {
    path: '/app/',
    element: <AppLayout />,
    errorElement: <ErrorPage />,
    children: [
      {
        index: true,
        element: <Postings />,
      },
      {
        path: 'postings',
        element: <Postings />,
      },
      {
        path: 'postings/:postingsId',
        element: <PostingDetailsPage />,
      },
      {
        path: 'workforce',
        element: <Workforce />,
      },
      {
        path: 'reports',
        element: <Reports />,
      },
      {
        path: 'enterprise',
        element: <Enterprise />,
      },
    ],
  },
]);

function App() {
  return <RouterProvider router={router}></RouterProvider>;
}

export default App;

And the AuthForm component

import { Form, Link, useSearchParams } from 'react-router-dom';

import classes from './auth.module.css';

function AuthForm() {
  // object that contains params, funct that sets params
  const [searchParams, setSearchParams] = useSearchParams();
  const isLogin = searchParams.get('mode') === 'login';

  return (
    <>
      <Form className={classes.form}>
        <Link to="/">
          <div className={classes.logo}>Bounty Jobs</div>
        </Link>
        <h1>{isLogin ? 'Log in' : 'Create account'}</h1>
        <hr />
        <br />
        <div className="inputs">
          <p>
            <label htmlFor="email">Email</label>
            <br />
            <input id="email" type="email" name="email" required />
          </p>
          <br />
          <p>
            <label htmlFor="image">Password</label>
            <br />
            <input id="password" type="password" name="password" required />
          </p>
        </div>
        <br />
        <div className={classes.actions}>
          <button>{isLogin ? 'Login' : 'Create'}</button>
        </div>
        <br />
        <div className={classes.actions}>
          Goto:
          <Link to={`?mode=${isLogin ? 'signup' : 'login'}`}>
            {isLogin ? 'Create new user' : 'Login'}
          </Link>
        </div>
      </Form>
    </>
  );
}

export default AuthForm;

code: 'ERR_REQUIRE_ESM' at 03-REACT-ESSENTIALS folder

I encountered an error after running npm run dev. Please see below's info:


PS C:\ReactProjects\ReactTheCompleteGuide2024inclReactRouteRedux\03-REACT-ESSENTIALS> npm run dev

[email protected] dev
vite

internal/modules/cjs/loader.js:1172
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\ReactProjects\ReactTheCompleteGuide2024inclReactRouteRedux\03-REACT-ESSENTIALS\node_modules\vite\bin\vite.js
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1172:13)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'ERR_REQUIRE_ESM'
}


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.