Git Product home page Git Product logo

Comments (5)

sylingd avatar sylingd commented on July 18, 2024 2

涉及到公司业务 在搞最小复现 但是对比了之前0.5.2和1.0.2的代码 发现有可能是lib下的css文件被压缩导致的…页面元素下没有对应的样式

新版本需要自行导入lib下面的css

from react-markdown-editor-lite.

sylingd avatar sylingd commented on July 18, 2024

请给出一个最小复现仓库,方便我们协助排查

from react-markdown-editor-lite.

xfause avatar xfause commented on July 18, 2024

涉及到公司业务 在搞最小复现 但是对比了之前0.5.2和1.0.2的代码 发现有可能是lib下的css文件被压缩导致的…页面元素下没有对应的样式

from react-markdown-editor-lite.

xfause avatar xfause commented on July 18, 2024

涉及到公司业务 在搞最小复现 但是对比了之前0.5.2和1.0.2的代码 发现有可能是lib下的css文件被压缩导致的…页面元素下没有对应的样式

新版本需要自行导入lib下面的css

多谢问题已解决。
另有问题

index.js
<MdEditor
   .....
   onChange={()=>{
     this.interval=setInterval(()=>{
       this.setState({value: some_value},()=>{
         MdEditor.use(MyPlugin,{
            props1:this.state.value
         })
         clearInterval(this.interval)
      })
      },1000)
   }}
>

Myplugin.js
class MyPlugin extends PluginComponent {
   .....
   render(){
     return <span>this.props.config.props1</span>
   }
}

此时MyPlugin中的this.props.config.props1不会即时更新 请问如何处理

from react-markdown-editor-lite.

sylingd avatar sylingd commented on July 18, 2024

不要这样使用。
如果是组件内部进行自增或者类似操作,用setState操作自己的state。
如果是来源于外部的,或者是几个组件共享的,考虑通过redux这类东西共享状态,或者通过events这类库进行事件监听然后forceUpdate/setState。

另外编辑器的相关事件,在组件内部,可以通过API更方便的监听,不建议在外部进行

from react-markdown-editor-lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.