Releases: davidtheclark/react-aria-modal
Releases · davidtheclark/react-aria-modal
5.0.2
5.0.1
5.0.0
- Remove
react-displace
package from dependencies - Update
focus-trap-react
package tov10.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>
);
}
}