Modal flashes when he exits, right?

This is probably a problem only a few people (including me) will encounter

When using

, the component suddenly flashes to the left as it exits (if the centered attribute is set, it flashes to the upper right).

why

ant-designThe <transition> name is not prefixed, and I happen to use the same name, causing CSS overwriting

Check for < A-Modal > components that are invoked on exit using the Elements developer tool in Chrome

.zoom-leave.zoom-leave-active {
    animation-name: antZoomOut;
    animation-play-state: running;
    pointer-event: none;
}
Copy the code

And I also set something called zoom-leave-active in the global style

.zoom-leave-active {
    position: absolute;
}
Copy the code

It just happens to pollute antD’s
name

The solution

My own<transition>nameAdd your own prefix