Skip to content

Releases: mbrookson/react-simple-hook-modal

v1.1.0

30 Oct 22:08
6202cfe
Compare
Choose a tag to compare

This release includes the following:

  • A new prop has been added to <Modal/> which allows adding custom classes to the modal element. Thanks to @jakewtaylor (#16)
  • Some dependencies have been upgraded with security patches

v1.0.1

14 Jul 19:21
7f18dc1
Compare
Choose a tag to compare

A recent change in v1.0.0 (#11) introduced the use of a React portal to render modals. This depends on window.document which is not available server-side.

This version fixes SSR in frameworks like Next.js by ensuring window.document exists before trying to use it. This means cannot be rendered on the server, but generally this isn't going to required.

v1.0.0!

13 Jul 23:07
9991843
Compare
Choose a tag to compare

Considering this now production ready since I'm using the version from npm in my own side project. I'll continue to improve as and where becomes necessary, or when issues are raised.

v1 has a breaking change.

  • Use standard React children instead of the content prop on Modal which has now been removed.

This version nw uses React portal and fixes an issue where you couldn't access a wrapper context inside Modal content because the actual ModalContainer was outside of the context due to how I hacked the hierarchy around how the modals were rendered. Using portal resolves this issue as the components are rendered in the correct hierarchy which is separate to the DOM structure.

Enjoy!

v0.2.0 - Transitions!

25 Apr 13:23
4010f29
Compare
Choose a tag to compare

Adds the ability to apply transitions to the modal. #1 #5

There are for options which are as follows:

  • NONE
    • Disables transitions
  • SCALE
    • Scales the modal from the centre
  • TOP_DOWN
    • Slides down from the top of the screen to the centre
  • BOTTOM_UP
    • Slides up from the bottom of the screen to the centre

These can be set by importing the ModalTransition enum from the library, and setting the transition prop on <Modal />.

v0.1.3

20 Apr 21:42
652a79d
Compare
Choose a tag to compare
Merge pull request #3 from mbrookson/feature/purge-unused-css

Improve bundle size and fix max-height bug

v0.1.2

20 Apr 19:14
Compare
Choose a tag to compare
Bump to v0.1.2