Giter Club home page Giter Club logo

Comments (9)

tianhuil avatar tianhuil commented on May 28, 2024 1

Added PR to DefinitelyTyped: DefinitelyTyped/DefinitelyTyped#43079

from mui.

amorey avatar amorey commented on May 28, 2024 1

Awesome! Thanks! Let me know when it gets merged and then we'll close this issue.

from mui.

amorey avatar amorey commented on May 28, 2024

Thanks for creating this issue. Are you currently running into this problem? Can you provide an example snippet?

from mui.

download13 avatar download13 commented on May 28, 2024
import React from "react";
import ReactDOM from "react-dom";
import { Input } from "muicss/react";

function App() {
  return <Input inputRef={() => console.log("hi")} />;
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

You should see an error in the console to the effect of TypeError: this.controlEl is undefined or Cannot set property _muiTextfield on undefined

https://codesandbox.io/s/quirky-wilbur-je6eg
The sandbox generates a lot of extra error output that's not helpful but the real error should be in there somewhere.

from mui.

tianhuil avatar tianhuil commented on May 28, 2024

@amorey, @download13: I encountered this issue as well. Proposed solution in #315

from mui.

amorey avatar amorey commented on May 28, 2024

Have you tried using the ref attribute to access the control element instead? Here's an example in the documentation for uncontrolled components:
https://www.muicss.com/docs/v1/react/input

from mui.

tianhuil avatar tianhuil commented on May 28, 2024

Thanks @amorey: that works as well but could we then add controlEl to the typescript definition for Input?

from mui.

amorey avatar amorey commented on May 28, 2024

Sure, though I'm not familiar with typescript. Can you submit a PR or show me how to add it?

from mui.

tianhuil avatar tianhuil commented on May 28, 2024

Hi @amorey: sorry for the delayed response. I'll try to add it.

from mui.

Related Issues (20)

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.