Giter VIP home page Giter VIP logo

Comments (9)

bilalbutt044 avatar bilalbutt044 commented on September 28, 2024 1

after adding enableReInitialize how to add onchange functioanlity ? i want to get data on Change.
I guess i am implementing in wrong way. here is my sandbox @Jungwoo-An
https://codesandbox.io/s/react-editor-js-h70bb

from react-editor-js.

spencerbass avatar spencerbass commented on September 28, 2024 1

I was able to fix my problem like this:

const [editorInstance, setEditorInstance] = useState(null);
    useEffect(()=>{
        if(display && editorInstance){
            if(conditions){
                editorInstance.clear();
            }else{
                editorInstance.render(props.data);
            }
        }
    },[props.thatShouldForceUpdates])

//within component
                    <EditorJs
                        data={props.data}
                        instanceRef={instance => setEditorInstance(instance)}
                        tools={{
                            ...COURSE_TOOLS
                        }}
                    />

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

@RathanakSreang Hi! First of all, thanks for your interest! ❤️

Can you serve me reproduce link? (ex: codesandbox)

Thanks!

from react-editor-js.

kbarnesweb avatar kbarnesweb commented on September 28, 2024

I am having an issue with enableReInitialize prop. I set data to {this.state.blogBody}.
blogBody is initially null as it is awaiting fetch from redux action. The data attribute doesn't work unless I have enableReInitialize prop set to true.

When I set enableReInitialize prop to true, two editors appear with the same blog body in each one.

from react-editor-js.

spencerbass avatar spencerbass commented on September 28, 2024

I'm having a similar problem as kbarnesweb where I see two editors at times, and both only show the loading circle animation. I've successfully initialized with data from the useState hook, but when I use enableReinitialize in order to change the data, I have the problem described above.

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

I'm sorry for late reply. I will check this issue asap. Thanks!

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

Hi! I made new PR (#26). I think this issue will be solved after merge PR #26

PR will be merged into master branch by tomorrow at the latest. If anyone have opinion, please PR comment

Thanks!

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

#26 PR has been merged. So i'll close this issue. If anyone have anything to say, please open issue.

from react-editor-js.

Jungwoo-An avatar Jungwoo-An commented on September 28, 2024

after adding enableReInitialize how to add onchange functioanlity ? i want to get data on Change.
I guess i am implementing in wrong way. here is my sandbox @Jungwoo-An
codesandbox.io/s/react-editor-js-h70bb

You can get changed data after define onChange prop. (Example)

Thanks!

from react-editor-js.

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.