Comments (3)
react-code-preview/src/useCodePreview.ts
Lines 40 to 52 in 97e4c6c
上面示例是找到 dom
重新 render
, 当你切换示例预览
的时候,导致 ReactDOMRoot
root 节点还是以前的,如下代码切换的时候 dom 节点被更新了
react-code-preview/src/index.tsx
Lines 195 to 216 in 97e4c6c
from react-code-preview.
@jaywcjlove 我知道。所以这块怎么改呢。
是不是应该在监听onPreview
为false属性中把这个dom移除掉呢
from react-code-preview.
@LonelyFellas 有一个解决方法,对预览的展示隐藏通过 css 去控制节点就不会被移除
from react-code-preview.
Related Issues (11)
- ERROR in ./node_modules/uiw-iconfont/fonts/w-icon.json Module parse failed: Unexpected token m in JSON at position 0 while parsing near 'module.exports = {"a...' You may need an appropriate loader to handle this file type. HOT 5
- 可以增加布局方向设置吗 HOT 1
- Action Required: Fix Renovate Configuration
- 打包之后,项目代码分析发现,babel占用也太大了,有办法处理一下吗 HOT 5
- Critical dependency: the request of a dependency is an expression HOT 3
- Dependency Dashboard
- 在 react 17 中报错
- problem in using in Nextjs HOT 1
- 这个组件能默认preview和code一起展示吗?。我的意思能Code默认打开的状态吗。 HOT 2
- docs ts几处报错问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-code-preview.