Build a Wordle Clone in ReactJS - Best React Project

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

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

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

    The first 1,000 people to use this link will get a 1 month free trial of Skillshare: skl.sh/pedrotech03221

  • @LiamGower
    @LiamGower 8 месяцев назад +1

    Amazing video. Started learning React 2 weeks ago slowly using Codecademy to get the basics down. I then decided to build my own Wordle to implement what I learnt in Codecademy, but soon learnt I didn't have a good-enough grasp about components interacting (in particular, the use of AppContext). Searched and found your video and boom this is perfect. Slowly chipped away at this video maybe 20 minutes a day and it has been amazing to grow my understanding.
    I will now look to implement other features on top of this (such as a nav bar, perhaps some animation and I would love to capture play statistics).
    Thank you so, so much!

  • @spasojeperovic5809
    @spasojeperovic5809 2 года назад +23

    Hey @PedroTech great video 🙌. At 1:30:31 you guessed the word but it didn't render the GameOver component. And I poked around in the code and realized that currWord is in uppercase. And it's solved by adding .toLowerCase() in for loop in onEnter function.

    • @sourajitachanda291
      @sourajitachanda291 Год назад +1

      Can you explain where should I add that?

    • @AdityaSharma-sy8lq
      @AdityaSharma-sy8lq Год назад +2

      @@sourajitachanda291 currWord += board[currAttempt.attempt][i].toLowerCase(); inside the App.js->onEnter->for loop

    • @n0tark349
      @n0tark349 4 месяца назад

      totally helped with that one, thanks

  • @ezeamaka
    @ezeamaka 2 года назад +11

    Seriously, the implementation of the logic behind this project is mind-blowing. I really enjoyed the thinking and implementation. Logic has been my most intimidating skill in programming. I find it difficult to think and implement with code, and it is my biggest roadblock. Any tip?

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

      I appreciate it :) I agree with you, coming up with logic is really daunting, and till this day I still struggle sometimes. The way I practice is by challenging myself with new projects that I know will require me to think logically. I also make sure I get as little help as I can from existing projects. Like, for this wordle, I had a basic idea in my head of what I wanted to do, but as I built the project I would be constantly finding bugs and tweaking my initial idea. So at the end, there is a working project!

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

      @@PedroTechnologies this is encouraging

  • @asifurrahman5436
    @asifurrahman5436 2 года назад +1

    I have seen many wordle clone, but i think your's is the most efficient one, well structured

  • @alexandra_b
    @alexandra_b 2 года назад +5

    Pedro, thank your for this amazing project! I really appreciate you using Context API here. Can't wait to watch the second part 👏

  • @notjunior5079
    @notjunior5079 Год назад

    this video is very underrated
    explanation of your code in every step is perfect even for people that just started working with react
    thanks man

  • @rakhisingh9797
    @rakhisingh9797 2 года назад +16

    Bro pls start a series using redux with frontend and rest api with backend.

  • @satyaprakashsahoo7772
    @satyaprakashsahoo7772 2 года назад +1

    Yes plz make the second part.. Plz plz... Lots of things we learn from you. Thanks Pedro

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

    What a legend. I will use the concepts learned here to incorporate this in my next project that will allow individuals to play three different games as part of an entire larger web application.

  • @YourTechWhiz
    @YourTechWhiz 2 года назад +1

    My mind is blown. 🤯
    You are a champ bro. 🙇🏻‍♂️❤️

  • @ivanstebler
    @ivanstebler 27 дней назад

    Superb explanation!
    Muchas gracias Pedro!

  • @boundless-sher
    @boundless-sher Год назад

    great video pedrotech. was super fun hoping for more fun projects like this

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

    You explained everything very nicely. Thankyou!!
    I was finding some course/video to clone quordle and then came across this video, helped me a lot.

  • @mdhasiburrahmannafiz9984
    @mdhasiburrahmannafiz9984 Год назад +1

    Thank you.
    And waiting for second part.

  • @codingforest7442
    @codingforest7442 2 года назад +1

    Many thanks, you really helped me to understand a lot of concepts in react js.

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

    Dude, amazing stuff thanks for everything! It would be cool to see like a twitter clone or linked in clone using React, redux toolkit and firebase v9. Most out are outdated

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

    🔥Pedro, thanks! Very good tutorial and excellent learning material. super! 👍

  • @silvajulio9856
    @silvajulio9856 2 года назад +1

    GOAT! I always learn a lot from your videos!!

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

    Great project.... Thanks bro 🔥🔥

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

    An excellent video. Thank you Pedro. Just done slightly too fast for me, but that is a minor issue. Yes please to the next video that 'finishes off' Wordle.

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

    Omg, great video Pedro as usual! This was amazing!

  • @srinivasabhargava4587
    @srinivasabhargava4587 Год назад +1

    at 1:30:39, your first guess was RIGHT which has the letter T(which is also a part of WRITE but not in the correct position) but it doesnt get highlighted in yellow. Is it because you are supposed to put the uppercase part for the almost part too?. Great video btw, learnt a lot.

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

    It’s really helpful for training react-hooks! Thank you 🙏

  • @simo5465
    @simo5465 9 месяцев назад

    Hello 😊
    I am trying to learn react and and I started with a long tutorial.
    I wanted to have some projects where can I apply the concepts learned, and seems the games can be good start, besides folowing the tutorial
    You explained it very well, nice tutorial, but for me seems that app function i's too big. I think you could have this in a separate file where you could have the provider there added, as a separate component.
    And then you can have wrap the 2 components, Board and Keyboard inside of it.
    But anyway, congrats and thank you!

  • @stanimirdimitrov4913
    @stanimirdimitrov4913 2 года назад +1

    Can you do a video on Jest and testing in general ? Like what should we test and an actual real world examples

  • @ИннаБогданова-к4щ
    @ИннаБогданова-к4щ 2 года назад +1

    thanx a lot, PEDRO!

  • @bradherr191
    @bradherr191 2 года назад +5

    I completed this and am getting 'word not found' for everything, I tried cloning your repo and still got the same thing. Any chance you know what im doing wrong? thanks in advance!

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

      I'm stuck in the same issue.

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

      same

    • @bureact
      @bureact 2 года назад +12

      Try const wordArr = result.split("
      ") in generateWordSet . solved from @Alexandra Baturina thanks

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

      @@bureact Legend this worked thank you so much

  • @arbros9093
    @arbros9093 2 года назад +2

    The OP project

  • @Degamer790
    @Degamer790 Год назад

    Thank you for this tutorial 😊 Can we use this project in our portfolios and do we need to attribute you?

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

    Thanks bro, it's well explained 👏

  • @HRkarthikHRkarthik
    @HRkarthikHRkarthik 6 месяцев назад

    thanks from india keep going sir

  • @jscardenasjr
    @jscardenasjr 2 года назад +1

    Hi Pedro, great tutorial! I'm just wondering if we could use class instead of IDs for the bigKey and colors? I think IDs should be unique in HTML. Thanks!

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

    Hi Pedro Can you make a video on google map that's a bit urgent as I am working on a project but after watching a lot of tutorials and google search I couldn't find the one which worked for me I understand your way of building concept which is very clear in each video please make one for me and also teach how to implement some functionalities on map , Love from pakistan

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

    great tutorial mate !

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

    Hi PedroTech,
    thanks for all the support for react /javascript developers,
    my request is please do a react video how to use* All the FORM components like radio btn, select box,Checkbox,input, ,calendar etc,and group of those elements* and practically what we use in industry to build apps **without any third part library please only use pure react with hooks***,bcz it will give the clear idea before moving in to formik or any other libruary,i would appreciate if u can use Mongodb for this.I know u will help on this.

  • @viniciusm.m.7822
    @viniciusm.m.7822 2 года назад +1

    Muito bom, mano!!!!
    Parabéns!
    God bless you!

  • @Ammarkoka
    @Ammarkoka 2 года назад +1

    Please make more video's on react and react projects

  • @olgamurashovadreyfus6862
    @olgamurashovadreyfus6862 Год назад +1

    when clicking letters on the keyboard, the letters appear vertically on the board, not horizontally. Anyone has a similar issue?

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

    its work my localhost but doesn't work on github pages. i have an error Word not found. Anyone help me ?

    • @jeremiaslandry9000
      @jeremiaslandry9000 2 года назад +2

      I have the same error on Vercel. Can someone explain why only works on local servers?

    • @miheertamkhane4833
      @miheertamkhane4833 Год назад +1

      I'm also having same error can anyone please check this out?

  • @SaptarshiMajumdar
    @SaptarshiMajumdar 2 года назад +1

    Hey Pedro,
    Thanks for the video I tried out the code but I am getting the alert 'Word not found' after the first attempt no matter what I type and the game does not progress to row two.
    I tried using your code fromyour repo but same problem.

  • @asijitmanna728
    @asijitmanna728 2 года назад +1

    I am stuck on the has function, what to do? its not searching through the word bank. I console logged and saw it was taking the correct input for searching only still it can't find the word.

    • @richyphongsavath
      @richyphongsavath Год назад +1

      I had the same issue. I added the .toLowerCase() to the end of the current Word since the words from the wordbank set are in lowercase. if(wordSet.has(currentWord.toLowerCase())){

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

    could you please make a serie about data structure and algorithms

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

    Hey Pedro I am big fan, please start full course using redux with frontend and rest api with backend and please use MySQL database to store data

  • @mob_abominator1868
    @mob_abominator1868 2 года назад +2

    I think the logic for checking if the word will fail if the word has an alphabet which appears more than once, eg: Shoot what about this ? If user enters scout or scoot wouldn't this fail ?

    • @ua2894
      @ua2894 2 года назад +1

      yes, when the word was "RIGHT" and he entered "RIGTT", the first "T" became yellow (1:00:40). According to the rules of Wordle, though, it should have turned gray since there is only one "T" in the word and it has already been found as correct.

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

      @@ua2894 yeah I think this algo will fail where users enters words with multiple alphabets or if the wordle itself has multiple alphabets. To solve this I suppose you have to run two loops seperately for perfect match and almost match.

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

      @@mob_abominator1868 does someone knows how to fix this?

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

    Good video BUT i have BIG problems seeing anything with that dark background och dark font-color, is it a div? a nav? bracket? conditionals... so hard to see...

  • @adimishra3046
    @adimishra3046 2 года назад +1

    Which theme, bro??

  • @smeetcoder9021
    @smeetcoder9021 2 года назад +1

    I am unable to type letter after first word is typed what's the issue can't understand?
    After lot of Time after debugging I copied your code but the same issue
    Plz help sir

  • @JenniferStewart100
    @JenniferStewart100 Год назад

    We can add a reset button if we want to, so the user can keep playing:
    // Reset the game function (Add right above first useEffect statement)
    const resetGame = () => {
    // Reload the page to reset the game
    window.location.reload(true);
    };
    // Add under return
    Reset Game in app.js under h1Wordle

    • @AnixSharma
      @AnixSharma 7 месяцев назад

      how to do it without reloading the page? as in SPA.

  • @lazys7151
    @lazys7151 2 года назад +2

    Hey, thanks for the video!
    Please fix code link in the description, it leads to the tik-tak-toe, not wordle

    • @PedroTechnologies
      @PedroTechnologies  2 года назад +1

      Thank you! My bad, didn't see the link. Just changed it :)

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

    Great work.

  • @ИннаБогданова-к4щ
    @ИннаБогданова-к4щ 2 года назад +1

    Pedro, Hello) In the very end of the video (1 hour 30 min) function 'almost' doesnot work acctially.

    • @ИннаБогданова-к4щ
      @ИннаБогданова-к4щ 2 года назад +1

      hi, to solve the problem that i mentioned you can write in App: setCorrectWord(words.todaysWord.toUpperCase())

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

      @@ИннаБогданова-к4щ i love you
      thank you so much
      how can i contact you?
      do you use telegram?

  • @aishwaryasahay8372
    @aishwaryasahay8372 Год назад

    I am getting the alert message for the correct words as well, can anyone tell where is the issue? i rechecked the code but I couldn't find the problem, can anyone suggest where it must have went wrong?

  • @miheertamkhane4833
    @miheertamkhane4833 Год назад +1

    I'm having problem with deployment, its working fine on my local but when I make it live of host it on netlify its breaking saying "Word is not found in bank" not able to figure out. If someone have done this please share. Thank you!

    • @saiyeshwanthvarma1380
      @saiyeshwanthvarma1380 Год назад +1

      Having the same problem, please comment if you fixed it

    • @hareharan8884
      @hareharan8884 4 месяца назад

      i tried using this in Words.js , let wordArr = result.split(/
      ?
      /).map(word => word.trim().toLowerCase()); this helped me fix the issue in deployment

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

    The use effect function is not working in the app.js file. This is the error I`m getting "Uncaught TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_1__.useEffect) is not a function" Do you know why?

  • @konno_donnoi7851
    @konno_donnoi7851 2 года назад +1

    01:30:33
    t was in the word but it wasn’t highlighted as a yellow potential word
    and the correct word was write
    the yellow hint feature isn’t working

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

      I added “toUpperCase()” to the “almost” constant in Letter.js and it resolved this issue

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

      @@carlostbanks fixed it long ago… thank you very much still

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

    Can you please make a video with email verification or OTP for login framework

  • @brianwin
    @brianwin 2 года назад +1

    Why in the last code example, the I and T didn't become yellow?

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

      In the Letter.js file, the correctWord needs to include a lowercase version of the letter.

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

      @@Mattch9 for const almost, change coorectWord to lowercase.

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

    which theme do you use?

  • @vishal.sharma.30
    @vishal.sharma.30 Год назад

    the error you didnt resolved is that if a person is gusseing a word that doesnt exist at the last attempt it is increasing the attempt count and thus having a gameover is triggered and resulting in failed.

  • @ayushchandra2510
    @ayushchandra2510 3 месяца назад

    there is a problem in this we are able to submit the same word more than once which we dont want

  • @siddharthchandrakar5617
    @siddharthchandrakar5617 Год назад +1

    but almost wright(yello part) thing is not working....

  • @psydook
    @psydook 2 года назад +2

    i'm getting an error which says Word Not Found! Anyone got it? I've been trying to troubleshoot it for a long time

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

      Can you paste your code? My guess is that u defined word with capital W but used lowercase w. Also, maybe you forgot to import the word variable from the context

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

      @Unassailable Optimist I had the same issue. Try const wordArr = result.split("
      ") in generateWordSet - it will remove all spaces.

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

      I had this issue as well and have not yet solved it. The words.wordSet is loading correctly, but after setWordSet(words.wordSet), the wordSet isn't actually being populated for some reason.
      setWordSet(words.wordSet);
      setCorrectWord(words.todaysWord);
      console.log("words.wordSet has " + words.wordSet.size + " words, but wordSet has " + wordSet.size + " words");
      Console:
      words.wordSet has 2315 words, but wordSet has 0 words

    • @drewmorrison2303
      @drewmorrison2303 2 года назад +1

      @@alexandra_b This solved the issue for me. Thank you!

  • @AnixSharma
    @AnixSharma 7 месяцев назад

    how to add reset function without reloading the page, but adding all states to default? why this function not working?
    const resetGame = () => {
    setBoard(startingBoard);
    setCurrAttempt({ attempt: 0, letterPos: 0 });
    setGameOver({ gameOver: false, guessedWord: false });
    setDisabledLetters([]);
    // generateWord().then((randomWord) => setCorrectWord(randomWord));
    };

    • @AnixSharma
      @AnixSharma 7 месяцев назад

      yo guys found the solution! setBoard(defaultBoard) isn't working because, the value of defaultBoard which should have been empty is changed to the typed letters, dunno why.. so manually put > setBoard(//manually put empty matrix of 6*5//) here. and it will work. cheers mate!

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

    Please build a card game(drinking game) in react/react native. Thanks in advance🙏

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

    You're smart

  • @manoj-k
    @manoj-k 2 года назад +1

    🔥🔥🔥

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

    logic isn't good what about t that turned yelow when you geuused already', but relly nice tutorial

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

    18.35

  • @adimishra3046
    @adimishra3046 2 года назад +7

    If anyone finding difficult to split the word just try this :-
    const WordArr = result.split(/
    ?
    /);
    Keep Coding 🙂🙂

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

      My code wasn't working just debugged it, all thanks to you ...I just replaced "
      " with your one.I wonder how come he is getting no error and how come it solved my problem ..Any idea ?

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

    Anyone else have an issue at to where the GameOver component is not rendering after implementing the random word functionality? I have everything working, even when the user does not get the correct word, but it does not change when I do the correct word. I think it has something to do with this part:
    let currWord = ''
    for (let i = 0; i < 5; i++) {
    currWord += board[currAttempt.attempt][i]
    }

    • @rafaelrios5250
      @rafaelrios5250 2 года назад +1

      I figured it out.
      change: if (currWord() === correctWord) {
      setGameOver({gameOver: true, guessedWord: true})
      }
      to
      if (currWord.toLocaleLowerCase() === correctWord) {
      setGameOver({gameOver: true, guessedWord: true})
      }
      Otherwise the current guess will be uppercased and the correct answer is lowercased hence the app will not recognize it as correct

    • @OskarsBestt
      @OskarsBestt Год назад +2

      @@rafaelrios5250 i solved the problem with the .trim function because there were some weird spaces in of the consts
      if (currWord.trim().toLowerCase() === correctWord.trim().toLowerCase()) {
      setGameOver({gameOver: true, guessedWord: true})
      }

    • @christdolphin69
      @christdolphin69 Год назад

      thank you king
      @@OskarsBestt