React JS Tutorial - Create A Simple Login System Episode #2 of #3

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

Комментарии • 50

  • @FullstackDevelopment
    @FullstackDevelopment  5 лет назад +30

    This is the CSS used:
    body, html, #root, .app, .container {
    width: 100%;
    height: 100%;
    }
    .container {
    font-size: 28px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #282c34;
    }
    .loginForm {
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    padding-left: 20px;
    padding-right: 20px;
    }
    .inputField {
    padding-top: 16px;
    }
    .input {
    box-sizing: border-box;
    outline: none;
    border: solid 2px #1189de;
    border-radius: 4px;
    color: #292929;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 1);
    }
    .submitButton {
    padding-top: 16px;
    }
    .btn {
    width: 100%;
    min-width: 280px;
    color: #565656;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    border: solid 2px #1189de;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    }

  • @umutturan9282
    @umutturan9282 4 года назад +3

    Great job! Thank you!

  • @briandacebreros20
    @briandacebreros20 4 года назад +2

    Thank you!

  • @mattsathrohan288
    @mattsathrohan288 2 года назад

    Great tutorial thank you so much! Can I use a rails backend for this? or does it have to be js?

  • @ferasalawadi4273
    @ferasalawadi4273 4 года назад +1

    amazing

  • @gauravtrivedi2132
    @gauravtrivedi2132 3 года назад +1

    why its showing ×
    TypeError: this.props.onClick is not a function ?? can any one help??

  • @kouta1234
    @kouta1234 4 года назад +1

    nice thx bro

  • @fiq1999
    @fiq1999 3 года назад

    when trying to input text on my fields I get errors like this.state is not a function and val.trim is not a function, any idea what might be the problem?

  • @gainknowledge5527
    @gainknowledge5527 4 года назад +10

    Can you just share code link
    Or any github

  • @chinmayteni1728
    @chinmayteni1728 3 года назад +2

    SyntaxError: D:\project\frontend\src\LoginForms.js: Unexpected token, expected ";" (45:8)
    })
    try {
    45| > Let res = await fetch('/login', {
    ^
    method: 'post',
    headers: {
    'Accept': 'application/json',
    why i am getting this error ???

    • @asher4818
      @asher4818 3 года назад

      also getting this error; have you figured it out?

    • @chinmayteni1728
      @chinmayteni1728 3 года назад +1

      @@asher4818 yess do not use capital 'L' for let

    • @asher4818
      @asher4818 3 года назад

      @@chinmayteni1728 still getting the same error. Is your coding running fine?

    • @chinmayteni1728
      @chinmayteni1728 3 года назад

      @@asher4818 whats is the error?

    • @asher4818
      @asher4818 3 года назад

      @@chinmayteni1728 ./src/App.js
      SyntaxError: C:\Users\asher\OneDrive\Desktop\SYSKAMVP2021\khaya\frontend\src\App.js: Unexpected token (43:7)

  • @GiangNguyen-cg8nm
    @GiangNguyen-cg8nm 4 года назад +1

    I get stuck with the input box and the placeholder didn't appear. And after entering username and password, it didn't show logout button. Although I did exactly like in the tutorial

  • @saydamuxamil2263
    @saydamuxamil2263 3 года назад

    any 1 help me pls I suck at this code... data did not save in session in other words cant show the logout page

  • @400racr
    @400racr 3 года назад

    after linking the css it looks close, except there is a small white border all around the body that adds a scroll bar, additionally the font family of Login Form is the browser default, do you know why this is

    • @ariefsaferman
      @ariefsaferman 3 года назад +1

      i add some padding-bottom in .container, fix for me

  • @jackieg3291
    @jackieg3291 4 года назад

    in this inputfield
    type='text'
    placeholder='Username'
    value={this.state.username ? this.state.username : ' '}
    why do we need the last ' ' part?
    I guess, If the username value doesn't exist, then we just can use the empty value this.state.username.
    It seems the below expression might be the same expression as your expression.
    value= this.state.username

    • @yaelcodez2631
      @yaelcodez2631 3 года назад

      You need the empty string to have a value there. Otherwise instead of a value/String it would be undefined.

  • @laquenelle6562
    @laquenelle6562 3 года назад

    When I try to see if my Submitbutton is on the page ( so until 3.00minutes )
    I got " Element type is invalid : expected a string ( for built in components) or a class/function ( for composite components) but got : undefined...."
    my code is the same as you
    Can you help me please ?

    • @laquenelle6562
      @laquenelle6562 3 года назад

      Also " you likely forgot to export your components from the file it's defined in, or you might have mixed up default and named imports"
      Check the re der method of ´App'

  • @jurgensubat2827
    @jurgensubat2827 3 года назад

    sad, it is unusable for beginners... It starts in my environment with an error message and forced me to set each component to "export default NEW [component-name]. Without the "new" I got only an error and the application doesn't rendered.
    I said to myself, OK... I enter in each component a "new"...
    As I entered the Submit-Button the application said "Good Night" and nothing works anymore...
    The only thing what I can do is now to google for another tutorial...
    By the way... The explanations were good and I understand everything in my opinion but unfortunately something went wrong but I have no clue what...

    • @muhammadparacha
      @muhammadparacha 10 месяцев назад

      Beginners should not be learning "full backend" untill they've learnt frontend (eg: react), how APIs work, express, databases and some nodeJS. You should learn those before combining them :)
      Hope this helps

  • @manofqwerty
    @manofqwerty 4 года назад

    I am having issues with the mobex UserStore not keeping the state following a refresh. Any idea what the issue may be?

    • @johnmcaulay4348
      @johnmcaulay4348 4 года назад

      Me too! I'm struggling to fix this.

    • @johnmcaulay4348
      @johnmcaulay4348 4 года назад +2

      I figured it out. My mysql query call was missing a parameter.
      In Router.js (around line 105) I had:
      db.query('select * from user where id = ? LIMIT 1', (err,data,fields) => {
      When I needed:
      db.query('select * from user where id = ? LIMIT 1', cols, (err,data,fields) => {
      Unlikely this is your problem, but I thought I'd share.

  • @tomwallace6250
    @tomwallace6250 3 года назад

    I keep gettin this warning in console:
    "Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: UserStore@4.loading"
    So my when i click login button my async doLogin method is never called

    • @tomwallace6250
      @tomwallace6250 3 года назад

      can anyone help?

    • @ahadaman9681
      @ahadaman9681 3 года назад

      @@tomwallace6250 In index.js remove

    • @spencersmith4305
      @spencersmith4305 3 года назад +2

      in UserStory.js
      import {runInAction} from 'mobx'
      and add
      setLoading = (loading) => {
      runInAction(() => {this.loading = loading})
      }
      setLoggedIn = (isLoggedIn) => {
      runInAction(() => {this.isLoggedIn = isLoggedIn})
      }
      setUsername = (username) => {
      runInAction(() => {this.username = username})
      }
      then whenever you are modifying loading, isLoggedIn, or username from an async function make sure to use those functions

  • @maryambah8234
    @maryambah8234 4 года назад +4

    Thank you very much ! men can you share the code link please?

  • @mahdibenzina9723
    @mahdibenzina9723 4 года назад +1

    POST localhost:3000/login 404 (Not Found) ??????????

  • @DidierMFB
    @DidierMFB 4 года назад

    SyntaxError: D:\Work\DAT load board\truckfreight\login-cmpt\src\LoginForm.js: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (10:4)
    8 |
    9 | construstor(props) {
    > 10 | super(props);
    was not able to fix this for quite some time

    • @terryq5995
      @terryq5995 4 года назад

      There is a typo in line 9. Should be "constructor(props)"

  • @andreealobontiu7879
    @andreealobontiu7879 4 года назад

    i get the input field in my browser, but when i start to type it changes to an error: TypeError: this.props.onChange is not a function
    can anyone help?

    • @tiennamnguyen9820
      @tiennamnguyen9820 4 года назад

      I have the same problem and don't know how to fix it

    • @NeedforSpeedGamesforpc
      @NeedforSpeedGamesforpc 4 года назад

      make sure you are passing onChange prop from the parent component who is using this input field.