Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Answered

Deprecated "findDOMNode" in Checkout module while clone

Posted on by Microsoft Employee
I'm getting an error after cloning the Checkout Module in D365 Commerce after extending the theme, is there any possible ways for an alternate solution? 
 
---------------------------
private readonly focusOnFirstFocusableElement = (): void => {
        const node = ReactDOM.findDOMNode(this) as HTMLElement;
        const focussableElements = `
             a:not([disabled]),
             button:not([disabled]),
             input[type=submit]:not([disabled]),
             input[type=checkbox]:not([disabled]),
             input[type=text]:not([disabled]),
             input[type=radio]:not([disabled]),
             input[type=password]:not([disabled]),
             select:not([disabled]),
             textarea:not([disabled]),
             [tabindex]:not([disabled]):not([tabindex="-1"])
         `;

        const child = node && node.querySelector && (node.querySelector(focussableElements) as HTMLElement);
        child && child.focus && child.focus();
    };
  • Verified answer
    WillWU Profile Picture
    WillWU 22,350 on at
    RE: Deprecated "findDOMNode" in Checkout module while clone

    Hi partner,

    It might because of the strict mode in React.

    StrictMode currently helps with warning about deprecated findDOMNode usage, when strict mode is enabled, React compiles a list of all class components using the unsafe lifecycles, and logs a warning message with information about these components.

    Please try to change <React.StrictMode><App /><React.StrictMode> to <App /> in index.js

    Such as the following screenshots

    pastedimage1639102591082v1.png

    You have to comment it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans