Giter VIP home page Giter VIP logo

Comments (5)

securingsincity avatar securingsincity commented on September 26, 2024

I'd be open to a pull request go for it (sorry for the late response) @captncraig

from react-ace.

drewen avatar drewen commented on September 26, 2024

ReactAce looks to have an editor property, which is the wrapped editor. As you suggested, you could use refs to get to the component, and then you should be able to use the editor on the component to run the function you need:

const reactAceComponent = parent.refs.reactAceComponent;
const editor = reactAceComponent.editor
editor.find(searchRegex, {
   backwards: false,
   wrap: true,
   caseSensitive: false,
   wholeWord: false,
   regExp: true,
});

As you said, a bit odd, but it should work. Hopefully this helped. If that doesn't work, I can put together a PR to put in that passthrough.

from react-ace.

lukaszczapiga avatar lukaszczapiga commented on September 26, 2024

Why not just expose the editor instance through a callback passed down to the AceEditor component? Then users would have full access to the underlying editor's API.

EDIT:
I found that the editor instance is returned from onLoad so it should be possible to call methods on the editor using that instance, correct?

from react-ace.

securingsincity avatar securingsincity commented on September 26, 2024

@lukaszczapiga that is correct the instance of the editor is available onload but as @drewen mentioned you can access it on the parent component using the ref

from react-ace.

securingsincity avatar securingsincity commented on September 26, 2024

This is now documented in the repo in a few ways. I'm going to close this issue.

from react-ace.

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.