Hi, everyone.
We need small validation in ReactAce. We don't want to allow users submit code event with any kind of warnings. ReactAce show that warnings (like missing semicolon). As I know, there is no standard way to get the results of validation. (Issue #144) Am I right?
If so, I suggest to add a new callback prop onValidate. We can add listener on change annotations and invoke that callback. For example:
editor.getSession().on('changeAnnotation', function() {
const annotations = editor.getSession().getAnnotations();
onValidate(annotations);
});
If that functionality make sense, I could work on PR. What do you think?
@tsmirnov I think that sounds good. I would like to see a PR.
This will be live in 5.2.0 which is going live now.
Any documentation for this? I don't want to allow the user to submit if there are errors. @securingsincity
Was able to find it, I added a ref then this.editorRef.current.editor.session.$annotations was the path towards it.
Most helpful comment
This will be live in
5.2.0which is going live now.