0

I have an issue in the console when I open Offcanvas:

Issue: Failed prop type: Invalid prop nodeRef of type function supplied to Transition, expected object.

I share my code:

import { Button, Offcanvas, OffcanvasBody, OffcanvasHeader } from 'reactstrap';

function App() {

  return (
    <div className="container mt-3 p-1">
      <div>
        <Button
          color="primary"
          onClick={function noRefCheck() { }}
        >
          Open
        </Button>
        <Offcanvas
          isOpen={true}

          toggle={function noRefCheck() { }}
        >
          <OffcanvasHeader toggle={function noRefCheck() { }}>
            Offcanvas
          </OffcanvasHeader>
          <OffcanvasBody>
            <strong>
              This is the Offcanvas body.
            </strong>
          </OffcanvasBody>
        </Offcanvas>
      </div>
    </div>
  );
}

export default App;

Please find the solution if you know the issue

1 Answers1

0

You are missing the transtition prop. Simply add the fade prop to Offcanvas component

<Offcanvas fade isOpen={true} toggle={function noRefCheck() {}}>
johnyleo
  • 1
  • 1