This React Library Blew My Mind - React Flow Course in 30 minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ค. 2024
  • Hi all, in this course we will discuss one of the best React Workflow and Flowchart library, React flow. In this tutorial I will make a React flow project and will cover the following concepts while making it:
    1) React Flow Concepts
    2) Nodes, Edges, Handles in React Flow
    3) Add/Delete Nodes, Edges in React Flow
    4) Custom Nodes, Edges, Handles in React Flow
    Join my discord: / discord
    You can follow me on: / usmanabdurrehman97
    Code: github.com/usmanabdurrehman/r...
    00:00 Intro
    00:06 Project Intro
    00:50 React Flow Concepts
    01:21 React Flow Component
    01:53 Adding Nodes in React Flow
    03:20 Adding Edges in React Flow
    04:33 fitView prop
    04:56 React Flow Plugins
    06:05 Using State in React Flow
    07:41 onConnect prop
    08:59 Reviewing the project
    09:25 Adding Custom Node Component
    12:46 Adding Handle in Custom Node Component
    13:40 Adding Payment Country Custom Node
    17:18 Adding Payment Provider Custom Node
    19:43 Deleting a Node
    20:43 Adding Payment Provider Select Custom Node
    22:12 Adding a Node
    24:20 Adding Custom Edge
    25:28 Delete an Edge
    28:21 Adding Custom Handle
    30:00 Outro

ความคิดเห็น • 55

  • @skullhunter7342
    @skullhunter7342 2 หลายเดือนก่อน +5

    Bro gave 2 hours of code in just 30 mints 🫡🗿

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      Is this a compliment or a roast because I am not quite sure :3

    • @skullhunter7342
      @skullhunter7342 2 หลายเดือนก่อน

      @@usmanabdurehman97 nah bro, I'm just appreciating how well you coded in just 30 mints but where you learnt this much because it's hard to go so much deep just by reading docs. 🫡

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      oh cool. Thanks. I took inspiration about the project from the demos page they have. A lot of people have built very complex stuff using react-flow.

  • @HideBuz
    @HideBuz 2 หลายเดือนก่อน +1

    Thank you for the tut! Just what I was looking for.

  • @DJRagemusic
    @DJRagemusic 3 หลายเดือนก่อน +1

    Good job bro, That was very helpful

  • @ThomazMartinez
    @ThomazMartinez 2 หลายเดือนก่อน +2

    Dude this is amazing work so much better than what eve seen other YT done, thank you

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      Thanks man. Your comments are what keep me going 😭

  • @K.Huynh.
    @K.Huynh. หลายเดือนก่อน +1

    thank you for sharing!

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      Thanks for leaving this comment :)

  • @SajjadAhammed-c8d
    @SajjadAhammed-c8d หลายเดือนก่อน +1

    This video has been really helpful

  • @usernamenotfound1229
    @usernamenotfound1229 2 หลายเดือนก่อน

    just awesome 👌👌👌👌 thank you very much

  • @patmw
    @patmw 2 หลายเดือนก่อน +1

    It would be great to see how you would go about serializing the graph and loading it again later.
    For example for saving and sharing workflows with your team mates

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      I will sore sure include it in the next course. Thanks for the recommendation.

  • @adaezendupu9488
    @adaezendupu9488 3 หลายเดือนก่อน

    Awesome!! Thanks for this. Is there a way to have arrow heads at the end of your edges pointing to a target?

    • @usmanabdurehman97
      @usmanabdurehman97  3 หลายเดือนก่อน

      Glad you liked it :). Yes there is. Since you have the ability to add a custom handle, you can use css clip path to make whatever kind of shape you want for the handle. Also, you can use some image as background for the handle etc.

  • @intensedolly
    @intensedolly หลายเดือนก่อน +1

    Great video, show the drag and drop and how csn we save them, also i was bit confused with you were importing components, like how do we know what it is used for?
    .
    Great video by the way,thanks!

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      Thanks for the comment. You can just save the json state in the db or local storage depending on if you app has a backend or not and then load it whenever the app opens.
      Regarding the workflow, I had a dummy idea for a workflow where we would enter a payment(initialize) with some amount like 300$, then select any particular country(currency) and then select a particular payment provider by connecting different edges with each other. You can then use the state to add whatever logic you want.

  • @sonaljain6216
    @sonaljain6216 หลายเดือนก่อน

    This is insane. Very nice & simple explanation.
    Would be interested to know how much time did it take you to learn this in such an amazing manner.

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      Thanks :'D. Took around 2 weeks for learning library + project + script for the video etc.

    • @sonaljain6216
      @sonaljain6216 หลายเดือนก่อน +1

      @@usmanabdurehman97 That's amazing!! Thanks for the video.

  • @ralphwealth163
    @ralphwealth163 3 หลายเดือนก่อน

    Please make more react flow tutorials

    • @usmanabdurehman97
      @usmanabdurehman97  3 หลายเดือนก่อน +1

      For sure. This is an amazing library, and I would love to make more project-based tutorials using it. Be on the lookout for more in 1-2 months.

  • @phucluu1247
    @phucluu1247 3 หลายเดือนก่อน

    Thank you for your job. Can you guide about create node for automation browsers?

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      Thanks for the appreciation. Can you elaborate it a bit on what you mean? I didn't get it.

    • @phucluu1247
      @phucluu1247 2 หลายเดือนก่อน

      @@usmanabdurehman97 i mean that create node about browser such as "click", "typetext", "openur", "newtab"...

  • @Omesh7
    @Omesh7 หลายเดือนก่อน +1

    This is great, can you show them the real world working demo, how things work in the background, when connected, what's the logic behind that

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      This is a dummy workflow so there is not real logic behind it.

    • @Omesh7
      @Omesh7 หลายเดือนก่อน +1

      @@usmanabdurehman97 yes, i can see that, but can you make or refer videos about using this in real-projects for.eg, a simple payment app like your dummy example but actual working, like what how and what happens in background when we connect these nodes and then initiate a payment. and save the workflow retrieve them, then use it. liek that

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      I am planning a video regarding its usage in a real project based on its implementations I have seen. It would be out within 1,2 weeks.

  • @seshuvuggina1912
    @seshuvuggina1912 2 หลายเดือนก่อน +1

    How can positions be generated? Is it done manually or is there an automated process for generating them?

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      For this particular example, I have a working area of 500*500. So, I am using Math.random() * 500 to generate x,y coordinates for the nodes I am adding so that they land inside this working area.

  • @ThomazMartinez
    @ThomazMartinez 2 หลายเดือนก่อน +1

    But one thing i dont get how to pass data from Node 1 to Node 2? I dont see this done thru Edges, so when onConnect is done do i need to loop over Node 1 to get its props and then Loop over Node2 to pass there?

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      You can use any way. You can do what you told where you in the onConnect function mutate the state for the node to pass custom data to it which can be the data of some node as well. You can also use some state management library like zustand and keep a global state tree where the key of the state is the id of the node and the value is the respective data. Then you can use that state in any custom node component. Do anything which makes more sense to you based on your needs.

    • @ThomazMartinez
      @ThomazMartinez 2 หลายเดือนก่อน +1

      @@usmanabdurehman97 using zustand works greats its just the looping part over and over i dont really like i was hoping that this lib has some magic function that stores values nicely that they can be referenced by id easally without loop but i guess i can always build this myself

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      yeah, looping is not great. Use Zustand then and keep a global object for node data

  • @ThamaraiSelvi-bi7mz
    @ThamaraiSelvi-bi7mz 2 หลายเดือนก่อน

    Please Bro Can you make a tutorial video for a custom group node with child node and give it that in side bar to drag and drop the group node along with its childnode in reactflow

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน +1

      I will make a complex React flow course within a month so will incorporate in that.

  • @Nomadnik_
    @Nomadnik_ หลายเดือนก่อน +1

    Any free library works same ??? I have to make one for my react proj. Data is huge tho.

  • @UsefulClips_
    @UsefulClips_ หลายเดือนก่อน +1

    sir if we add 2+ handles then its not working
    please help me regarding that

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      It should work. In the payment country component, I have got two handles. One source and one destination. Check if you are getting any errors in the console. Also
      cross-check your implementation with mine

    • @UsefulClips_
      @UsefulClips_ หลายเดือนก่อน

      @@usmanabdurehman97 yes sir i do that but the issue is when I add one target and two sources then target and one source is working and second source is not working can you please guide me regarding that or we can connect on google meet if possible

  • @abdullahshams5772
    @abdullahshams5772 3 หลายเดือนก่อน

    Really nice DEMO. Can you cover an example to save and load from JSON? Its a request

    • @usmanabdurehman97
      @usmanabdurehman97  3 หลายเดือนก่อน +1

      cool. Will add this in the advanced course I will make. Thanks for the comment

    • @abdullahshams5772
      @abdullahshams5772 2 หลายเดือนก่อน

      I am building a project demo, if you like we can collaborate, I can provide a real-world use case, that we are open to make open-source.

  • @navaneeth9103
    @navaneeth9103 2 หลายเดือนก่อน +1

    This will chnage on each refresh how can we save this

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      You will have to save the json object of the nodes/edges in a database/localStorage and load them on next page load or something depending on your application. I will include this in the next react flow course I make

    • @navaneeth9103
      @navaneeth9103 2 หลายเดือนก่อน

      @@usmanabdurehman97 thanks , i was able to do that actually , it was for test of a job . could not complete at time 😓.
      dicovered ur channel though , waiting for react flow course👍👍