We want a component that handles modal stack, which would allow us to:
- Properly set
z-indexfor modals - Close modals properly (e.g., on
escape)
<StackManager self={this}>
{(n, handler) => (
<Modal style={{ zIndex: 1000 + n }} onClose={handler.close(this.props.onClose)}>
</Modal>
)}
</StackManager>handler.closein this case accepts a function which returns a function that:- Invokes the provided function
- Proceeds to do its actual cleanup; removing the modal from the stack.