React-ace: 拼写错误的选项 - 再次!

创建于 2018-10-19  ·  5评论  ·  资料来源: securingsincity/react-ace

问题

此处报告的问题https://github.com/securingsincity/react-ace/issues/95被认为已修复,但不幸的是仍然出现:
在控制台中收到一些警告:
拼写错误的选项“enableBasicAutocompletion”
拼写错误的选项“enableLiveAutocompletion”

在此处详细说明问题,包括任何可能的解决方案。

这个问题的补救措施应该是这个 PR https://github.com/securingsincity/react-ace/pull/127 ,但它只解决了某些情况 - 对于其他情况,问题仍然存在。

根据错误详细信息,与该 PR https://github.com/securingsincity/react-ace/pull/127/files 中的类似更改也应在此处应用: https :

重现您的问题的示例代码

只需使用带有一些选项的编辑器,即:

<AceEditor
  setoptions={{
    enableBasicAutocompletion: true,
    enableLiveAutocompletion: true,
    enableSnippets: true
  }}
/>

并确保该 componentDidUpdate 被触发。

参考

进展:#

最有用的评论

结束 - 这个问题可以通过添加import 'brace/ext/language_tools';来解决

所有5条评论

结束 - 这个问题可以通过添加import 'brace/ext/language_tools';来解决

我通过以下方式解决了它:

import "ace-builds/src-noconflict/ext-language_tools";

@ziishaned这个导入似乎没有为我修复它。 你的进口是什么,什么顺序?

@ziishaned谢谢它的工作。 我将“react-ace”:“6.3.2”升级为“react-ace”:“^9.2.1”。

因此react-ace从 v8 开始不再使用brace包。

https://github.com/securingsincity/react-ace/issues/638#issuecomment -649181737

因此必须从“ace-builds/src-noconflict/ext-language_tools”导入扩展工具包;

从 v6 -> 8 迁移指南
https://github.com/securingsincity/react-ace/blob/main/docs/Migrate-v7-to-v8.md

@去滑雪
导入 'ace-builds/webpack-resolver';
导入 'ace-builds/src-noconflict/mode-java'; (用于主题目的)
导入 'ace-builds/src-noconflict/ext-language_tools';

...
为我工作。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

ponelat picture ponelat  ·  3评论

tsmirnov picture tsmirnov  ·  4评论

BenBrewerBowman picture BenBrewerBowman  ·  5评论

huangjiatian picture huangjiatian  ·  7评论

anderoonies picture anderoonies  ·  5评论