-
Notifications
You must be signed in to change notification settings - Fork 217
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
Bug: "classical" custom js will not work in 6.x. #7438
Comments
@smpn2 Thank you for your report.
You're right. "mdcont-" is added to avoid DOM clobbering, but I'm also aware that some users have pointed out another problem(e.g. the footnote links do not work by this). |
An off-topic fix, but the mdcont prefix will be removed in v6.1.0. |
It seems that it is no longer loaded with page transitions in v6. window.addEventListener('load', function() {
// add code here
var div = document.getElementsByClassName("dynamic-layout-root")[0];
var mo = new MutationObserver(function() {
// add code here
});
var config = {
childList: true,
subtree: true
};
mo.observe(div, config);
}); |
As @tthogehoge said, the only way to hack it at this point is to use the Mutation Observer. Of course, I'm not denying the technology similar to Next.js' SSR mode, but as long as it supports custom scripts, I think simple server-side rendering, which is old-fashioned and works reliably, is the best. I also think the problem is that this issue is not mentioned on the admin page. |
Environment
Host
Client
How to reproduce? (再現手順)
This is a sample case.
What happens? (症状)
Changing the DOM too fast will result in hydration errors.
https://reactjs.org/docs/error-decoder.html/?invariant=418
What is the expected result? (期待される動作)
Note
Of course I know that the "mdcont-" prefix will be given, but unlike the expected behavior so far, it is not clearly documented.
The text was updated successfully, but these errors were encountered: