rstan-dev/GarageGuru-PP5

small -items - upgrade Bootstrap to address Modal and accordion warnings

Opened this issue · 1 comments

small -items - upgrade Bootstrap to address Modal and accordion warnings

Leaving Bootstrap 4 as it is integral to the CI template. Address in Readme and turn off strict mode.

The warning you're encountering is related to the use of findDOMNode, which is a method in React that's considered legacy and is not recommended for use in new code. React's Strict Mode is warning you about its usage. This warning often appears when using certain third-party libraries that haven't fully updated their internal implementations to align with the latest React best practices, particularly around refs and DOM node access.

In the case of React Bootstrap and the Accordion component, this issue might be stemming from the library itself. Here’s how you can address or work around this issue:

Update Your Dependencies: First, ensure that you are using the latest version of React Bootstrap. The issue might have been fixed in a more recent version. Update it using npm

Check for Open Issues or Fixes: Look at the React Bootstrap GitHub repository or issue tracker. Other users might have encountered the same warning, and there might be discussions or fixes available.

Avoid StrictMode for Now: If the warning is not causing actual problems in your application and you cannot find a way to fix it, you might choose to temporarily remove React Strict Mode in development until the library is updated. However, be cautious with this approach, as Strict Mode helps catch many potential problems in your app.

Refactor to Use Functional Components and Hooks: If you are using class components, consider refactoring to use functional components with hooks. This can sometimes circumvent issues with older lifecycle methods and patterns that can lead to warnings in Strict Mode.

Provide Direct Refs: If you have control over the components causing the warning, try to follow the advice in the warning message: "Instead, add a ref directly to the element you want to reference." This involves using React's useRef hook or React.createRef() for class components.

Contribute to the Library: If you have the capability and the issue is indeed with React Bootstrap, consider contributing a fix to the library. Open-source libraries often rely on community contributions to improve.

Look for Alternatives: If the warning is causing significant issues and there is no immediate fix, consider using a different library or implementing the necessary functionality yourself, if feasible.