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

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

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

  • @kchaiprogramming6179
    @kchaiprogramming6179  4 года назад +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 3 года назад +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 7 месяцев назад

      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.

  • @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}

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

    react hook form update: From: To:

  • @louis-0412
    @louis-0412 2 года назад +2

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

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

    fantastic , please upload more videos

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

    This was really great and helpful, thanks so much!

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

    Great 👍

  • @MrCuteguylol
    @MrCuteguylol 3 года назад +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!

  • @HarshPatel-dv3hm
    @HarshPatel-dv3hm Год назад

    wonderful ❤

  • @syedsohailahmed6810
    @syedsohailahmed6810 11 месяцев назад

    very informative

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

    Thanks for the video. I love it.

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

    Thanks for this video!

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

    Thank you for sharing

  • @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

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

    Thank you.

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

    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  3 года назад

      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

  • @raulrothschild
    @raulrothschild 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.

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

    Good stuff

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

    Thanx

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

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

  • @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

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

    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 2 года назад

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