React / Reactstrap Warning: Legacy context API has been detected within a strict-mode tree

Nelles picture Nelles · May 7, 2020 · Viewed 19.5k times · Source

This is brand new install - I have not put any transitions on the Alert component

To replicate the code it is simple

import React from "react";
import { Alert } from "reactstrap";

export const Index = () => {
   return (
      <div>
         <Alert color='primary'>This is a primary alert — check it out!</Alert>
      </div>
   );
};

Error Msg: Please update the following components: Transition

enter image description here

How does one go about updating Transition or eliminating it all together?

Answer

Shanks picture Shanks · Aug 16, 2020

I have this same warning, and I fixed it changing in the index.js file, the value of <React.StrictMode> to <React.Fragment>. Since this removes the warning, is not guaranteed that your can be bulletproof.