Skip to content

Releases: davidtheclark/react-aria-modal

5.0.2

30 Oct 15:44
Compare
Choose a tag to compare

5.0.1

29 Oct 20:14
b2118e1
Compare
Choose a tag to compare
tag

5.0.0

06 Jun 21:38
d02afcb
Compare
Choose a tag to compare
  • Remove react-displace package from dependencies
  • Update focus-trap-react package to v10.1.4
  • Add support for React 18
  • Note: 5.0.0 introduces a breaking change to implementations where ref is referenced when the component is mounted:

Before

class Test extends React.Component {
  constructor(props) {
    super(props);
    this.contentRef = React.createRef();
  }

  componentDidMount() {
    // with react-aria-modal@4 it will print "{ current: div }"
    // now it will print "{ current: null }"
    console.log(this.contentRef);
  }

  render() {
    return (
      <div>
        <AriaModal titleText="Test">
          <div ref={this.contentRef}>
            Modal window content...
            <br/>
            <button>ok</button>
          </div>
        </AriaModal>
      </div>
    );
  }
}

After

The problem can be easily fixed in client code:

class DemoEleven extends React.Component {
  handleRef = divElement => {
    console.log(divElement);
  }

  render() {
    return (
      <div>
        <AriaModal titleText="demo eleven">
          <div ref={this.handleRef}>
            Modal window content...
            <br/>
            <button>ok</button>
          </div>
        </AriaModal>
      </div>
    );
  }
}