Comments (5)
I'd be open to a pull request go for it (sorry for the late response) @captncraig
from react-ace.
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.
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.
@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.
This is now documented in the repo in a few ways. I'm going to close this issue.
from react-ace.
Related Issues (20)
- editor focus comes out again and agian on onChange() while setState HOT 2
- Merge PR
- Move to React 17/18?
- Changing editor sessions causes session/selection listeners to stop firing
- Unable to fully display content when line length is too long HOT 1
- ace在多个微应用间,通过组件渲染切换,css样式丢失 HOT 3
- expected expression, got '<' HOT 1
- No System Verilog Support
- import 'ace-builds/src-noconflict/mode-javascript';
- State is equal to it's default value on commands exec function call HOT 2
- Are mode and theme imports required for react-ace?
- Problem with so many lines of code (10k lines of JSON)
- Textarea has not attr "name"
- How to dynamically import modes and themes ?
- ace is not defined in production only
- Missing spaces in auto-complete
- SplitEditor not showing annotations HOT 1
- react-ace 11.0.1 Ace editor giving console error UNTRUSTED_TYPES_CHECK_STACK_BELOW
- Why can't ArrowUp, ArrowDown, and Backspace trigger in keyboard events
- DiffEditor does not highlight diffs 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-ace.