@ -109,10 +109,10 @@ While the major version is being upgraded, some components are discarded, but th
});
```
During the conversion process, I discovered a magical phenomenon. In some cases, the DOM snapshot generated by the same case will be different, so I began to explore what has changed in React 18:
## Diff Mystery
During the conversion process, I discovered a magical phenomenon. In some cases, the DOM snapshot generated by the same case will be different, so I began to explore what has changed in React 18:
In the past, the `snapshot` comparison of `enzyme` was to convert the `enzyme object` into a serialized object through the `enzyme-to-json` plugin:
Consistent with the idea, then it is very simple. Then there is a high probability that the `render` of `React 18` will ignore empty elements. Let's do a simple experiment:
```tsx
import React, { version, useRef, useEffect } from 'react';
import React, { useEffect, useRef, version } from 'react';
const App: React.FC = () => {
const holderRef = useRef<HTMLDivElement>(null);
@ -251,7 +251,7 @@ You can find the relevant PR by following the map: