Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow model rendering to be overridden #42

Closed
wants to merge 1 commit into from

Conversation

dantman
Copy link

@dantman dantman commented Jul 24, 2021

This partially fixes #41 by allowing the way ModalProvider renders modals to be overridden.

e.g. A Material UI v5 project should be able to use this to make it compatible until MUI v5 is released and you make a new major for v5.

ReactDOM.render(
  <ModalProvider
    renderModal={params => {
      const { Component, props, key, handleClose, handleExited } = params;

      return (
        <Component
          {...props}
          key={key}
          onClose={handleClose}
          {...(handleExited && { TransitionProps: { onExited: handleExited } })}
        />
      );
    }}
  >
    <App />
  </ModalProvider>,
  document.getElementById('root')
);

Not sure how you want to document this.

@Quernest
Copy link
Owner

I closed this PR because merged the alternative.
#43

@Quernest Quernest closed this Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MUI Dialog API changed
2 participants