Git Product home page Git Product logo

Comments (5)

swayok avatar swayok commented on May 25, 2024

Got more info:

Uncaught TypeError: getOpenState is not a function
    at eval (Modal.tsx:87)
eval @ Modal.tsx:87
setTimeout (async)
eval @ Modal.tsx:85
eval @ Modal.tsx:147
invokePassiveEffectCreate @ react-dom.development.js:23482
callCallback @ react-dom.development.js:3945
invokeGuardedCallbackDev @ react-dom.development.js:3994
invokeGuardedCallback @ react-dom.development.js:4056
flushPassiveEffectsImpl @ react-dom.development.js:23569
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority$1 @ react-dom.development.js:11276
flushPassiveEffects @ react-dom.development.js:23442
performSyncWorkOnRoot @ react-dom.development.js:22264
eval @ react-dom.development.js:11327
unstable_runWithPriority @ scheduler.development.js:468
runWithPriority$1 @ react-dom.development.js:11276
flushSyncCallbackQueueImpl @ react-dom.development.js:11322
flushSyncCallbackQueue @ react-dom.development.js:11309
unbatchedUpdates @ react-dom.development.js:22433
legacyRenderSubtreeIntoContainer @ react-dom.development.js:26015
render @ react-dom.development.js:26098
eval @ app.tsx:14
./resources/assets/user_account/app.tsx @ app.js:18
options.factory @ manifest.js:614
__webpack_require__ @ manifest.js:36
__webpack_exec__ @ app.js:564
(anonymous) @ app.js:565
__webpack_require__.O @ manifest.js:90
(anonymous) @ app.js:566
webpackJsonpCallback @ manifest.js:1268
(anonymous) @ app.js:9

from mdb4-react-ui-kit.

swayok avatar swayok commented on May 25, 2024

I don't see this prop as required in prop types or any explanation about its purpose in docs.

declare const MDBModal: React$1.FunctionComponent<{
        animationDirection?: string;
        backdrop?: boolean;
        className?: string;
        closeOnEsc?: boolean;
        tabIndex?: string;
        show?: boolean;
        staticBackdrop?: boolean;
        tag?: React$1.ComponentProps<any>;
        modalRef?: React$1.RefObject<HTMLElement>;
        [rest: string]: any;
    }>;

from mdb4-react-ui-kit.

Wojstan avatar Wojstan commented on May 25, 2024

Thanks for Your report, we will fix this in the next release. For now, update the MDBModal component to look like this:

<MDBModal staticBackdrop show={debugModalContent !== null} getOpenState={(e: any) => e} tabIndex='-1'>




The problem is caused by the getOpenState property, which should be required except for the example with staticBackdrop.

from mdb4-react-ui-kit.

swayok avatar swayok commented on May 25, 2024

Hi. Thanks for reply. I've already done that to fix error for the time being.
While reviewing the code of Modal.tsx I came to realization that getOpenState(true) is redundant because modal visibility is handled by show property and I can't think of any situation when modal can show itself avoiding show property. In result only
getOpenState(false) is meaningful. So why not rename getOpenState to more understandable onClose or onBackdropClose and call it only when modal closes by any means except show property?

from mdb4-react-ui-kit.

Wojstan avatar Wojstan commented on May 25, 2024

Thanks for Your suggestion. We will think about changing the property name in the next release.

from mdb4-react-ui-kit.

Related Issues (15)

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.