How to create Reusable React Forms? JSON Hooks forms - Part 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 มิ.ย. 2024
  • How to create Reusable React Forms? In this video, we will use React hook form to create Form component that renders form using JSON. This short series explains everything you need to know to manage forms in React for any use-case.
    React Powerhouse
    React powerhouse is a series that shows you how you can create powerful web applications using React. This series is for moderate to advanced React users.
    📄 Check out the complete playlist - • How to create forms in...
    🔴 Subscribe for useful web development content - / @kchaiprogramming6179
    Resources
    💻 Code link - github.com/ChaitanyaKaranam/r...
    📃 React Forms - reactjs.org/docs/forms.html
    🎣 React-hook-form - react-hook-form.com/

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

  • @kchaiprogramming6179
    @kchaiprogramming6179  3 ปีที่แล้ว +2

    Here's the link for the source code - github.com/ChaitanyaKaranam/react-powerhouse

    • @funmora9140
      @funmora9140 2 ปีที่แล้ว

      How can we pass function to dynamic form

    • @vicerix
      @vicerix ปีที่แล้ว

      @@funmora9140 you solved or find an answer somewhere?

  • @baluchandran5670
    @baluchandran5670 2 ปีที่แล้ว +3

    My friend, I am a senior IT kind of person. Spent more than three decades in IT. The reason I am saying this, to establish the importance of what I am going to say. First - Wonderful and precise content - Thinking abstract out of the box are very few. After a long time I found one - it is you. I really enjoyed this journey of watching your video. But I was not happy to see the subscribers you got? Probably there is a mistake on your side as well. Then content in this video are really good but can be appreciated only by experienced people quickly. This means, you have to make contents for newbies running basics Piece by piece. We all know Koushik of Javabrains. Trust me, I enjoyed your video as if I am watching him on the show. Try to prepare some basic contents but don't miss to release dense contents like this - otherwise we may fly away :). You have good time ahead. make it natural and keep going.

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

      I really appreciate him. As you said it's for experienced people level of explanation. To get more subscribers and view, You have to explain little more detail but not too lengthy like UDEMY however i really loved it.

  • @craigcampbell4712
    @craigcampbell4712 2 ปีที่แล้ว +1

    This was really great and helpful, thanks so much!

  • @HarshPatel-dv3hm
    @HarshPatel-dv3hm ปีที่แล้ว

    wonderful ❤

  • @nancyhan8535
    @nancyhan8535 3 ปีที่แล้ว +1

    Thanks for the video. I love it.

  • @Pareshbpatel
    @Pareshbpatel 2 ปีที่แล้ว +1

    A very informative tutorial on creating re-usable React Forms using React-Hook-Form Library. Thanks very much.
    {2022-03-11}

  • @mithushanjalangan5132
    @mithushanjalangan5132 3 ปีที่แล้ว +1

    Thanks for this video!

  • @nick4bizz42
    @nick4bizz42 ปีที่แล้ว +2

    react hook form update: From: To:

  • @sounakroy9284
    @sounakroy9284 2 ปีที่แล้ว +1

    Great 👍

  • @MrXperx
    @MrXperx 3 ปีที่แล้ว +1

    Good stuff

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

    very informative

  • @fasttocode
    @fasttocode 3 ปีที่แล้ว +1

    Thank you.

  • @pankajmenaria3230
    @pankajmenaria3230 ปีที่แล้ว

    Thank you for sharing

  • @aravindm6124
    @aravindm6124 2 ปีที่แล้ว +2

    fantastic , please upload more videos

  • @louis-0412
    @louis-0412 2 ปีที่แล้ว +2

    Version 6.X.X:
    Version 7.0.X:

  • @MrCuteguylol
    @MrCuteguylol 2 ปีที่แล้ว +2

    Hi! This was a wonderful video, however is it possible if you also show us how to integrate the select tag in it? Thanks in advance!

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

    Thanx

  • @jaggyjut
    @jaggyjut 2 ปีที่แล้ว

    Cool. Could you show CRUD operations in the form and save it in a table grid within a page and backed as google firestore. Thanks

  • @cristhianjhlcom
    @cristhianjhlcom 3 ปีที่แล้ว +2

    Nice video, congratulations for the great content. I have a question I hope you can help me, I have a invoice form that need a detailed list but I build this detail from another component external to this form how can o validate that details have data and send the array of data with the submit form? Thanks 🤓

    • @kchaiprogramming6179
      @kchaiprogramming6179  2 ปีที่แล้ว

      You can make these checks at onSubmit function of your form.. alternatively.. you can send array of validations as a prop to your component, whenever onSubmit is fired, you can perform these validations

  • @raulrothschild5876
    @raulrothschild5876 3 ปีที่แล้ว +1

    Maybe you would create a and pass all props to them.
    Another thing u didn't think about is textarea, select, and the data within radio and checked buttons, useState has a strange behavior when you check and uncheck them.
    What about all other html inputs attr? Data Picker, file, button? I think creating a switch case for each one is kind bad, idk. Just my opinion, maybe adding custom hooks for validation would be easier.

    • @kchaiprogramming6179
      @kchaiprogramming6179  3 ปีที่แล้ว +2

      The example I showed above relies on react-hook-form which is used to create uncontrolled components. So, there is no need to rely on hooks or react state. You need to create similar case statements for all the other elements and for props you can create "props" filed in JSON and can spread it on element , but, this is just a one time activity. This approach is really useful when you have to dynamically control everything using only JSON. This JSON can be dynamically generated from the server and you can manipulate the form fields. If you don't have such use-case then this definitely is an overkill.

  • @dineshkarnhakim
    @dineshkarnhakim 2 ปีที่แล้ว +1

    Great video. How can I use multiselect and select component with backend api to call?

    • @kchaiprogramming6179
      @kchaiprogramming6179  2 ปีที่แล้ว

      For select and multiselect, you can have two additional fields, options and selectedOptions.. options would be an array, you can loop through them and render options, selectedOptions would be an array of strings or a string based on multiselect or select

  • @alanfljesus
    @alanfljesus ปีที่แล้ว

    How can I do this for a password confirmation when both have the case 'password'?

  • @siyaramrauniyar6929
    @siyaramrauniyar6929 ปีที่แล้ว

    Not usable with react hook form 7.

  • @ievabroberg5312
    @ievabroberg5312 2 ปีที่แล้ว

    I think there had been some changes for ref since the video and now validationProps don't work, having problems rendering errors, anybody has a solution?

    • @kchaiprogramming6179
      @kchaiprogramming6179  2 ปีที่แล้ว

      Looks like v7 of react-hook-form migrated from using refs.. you can just spread properties on register.
      You can see this here - react-hook-form.com/migrate-v6-to-v7/

    • @onlyamaras
      @onlyamaras ปีที่แล้ว

      @@kchaiprogramming6179 can you please provide the updated code for validationProps, I tried all the way but not able to get the right output.

  • @jrmsrs
    @jrmsrs 2 ปีที่แล้ว

    In a Django Rest Framework API when you use OPTIONS method you'll get a response like:
    {
    "name": "Table",
    "description": "",
    "renders": [
    "application/json",
    "text/html"
    ],
    "parses": [
    "application/json",
    "application/x-www-form-urlencoded",
    "multipart/form-data"
    ],
    "actions": {
    "POST": {
    "id": {
    "type": "integer",
    "required": false,
    "read_only": true,
    "label": "ID"
    },
    "name": {
    "type": "string",
    "required": true,
    "read_only": false,
    "label": "Name",
    "max_length": 50
    },
    }
    }
    }
    }
    Would I be able to do something similar to get the fields of objects in "actions. POST" in this more dynamic way? Since it's not an array I think i can't do table.map() for example

    • @kchaiprogramming6179
      @kchaiprogramming6179  2 ปีที่แล้ว

      The keys of object POST seems off, but still, you can use Object.keys to loop through keys and access elements using actons.POST[key] or you can just loop thourgh values using Object.values