Giter Club home page Giter Club logo

mui-rhf-library's Introduction

๐ŸŒ Socials:

Behance LinkedIn Twitter

๐Ÿ’ป Tech Stack:

CSS3 HTML5 JavaScript TypeScript Expo Laravel Next JS Redux TailwindCSS Vue.js Vuetify Sketch Figma React Native React

๐Ÿ“Š GitHub Stats:



๐Ÿ† GitHub Trophies


mui-rhf-library's People

Contributors

dashty94 avatar dependabot[bot] avatar revan99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

revan99

mui-rhf-library's Issues

DatePickerController??

Hi there,

Is the DatePicker Controller missing from the exports?

If not how do we use this as it doesn't seem to have its own controller?

Accepting a react FC as a CustomComponent encourages declaring a react component inside another

Problem

The problem is that when you want to pass some props down to the custom component, you have to declare a component to be able to accept the props outside, and that causes issues as such:

  • React doesn't know what has changed inside that custom component because whenever it sees it. It recreates it again on each parent re-render, that makes it impossible to detect changes.
  • It's very expensive to re-create that custom component each time parent renders.

Problematic Example

{
  name: "values",
  fieldType: 'custom',
  label: t('model.attributes.payable.values.label'),
  CustomComponent: () => <ValuesInValuesField currentValue={currentValue} values={values} />,
  gridProps: { xs: 12 }
}

The desired usage

{
  name: "values",
  fieldType: 'custom',
  label: t('model.attributes.payable.values.label'),
  CustomComponent: <ValuesInValuesField currentValue={currentValue} values={values} />,
  gridProps: { xs: 12 }
}

Solution

Accept a React node for CustomComponent instead of a react component:

export type CustomComponentControllerProps = MuiRhfFieldProps & {
    CustomComponent: React.ReactNode;
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.