当 npm 构建过程运行时,出现错误“路由器”无法用作 JSX 组件。其实例类型“BrowserRouter”不是有效的 JSX 元素。 发生。可能是什么原因?
我使用的是节点 v14.18.3。package.json 文件如下所示。
我更新了react-intl包但没有得到任何结果,这是在devOps构建服务器中发生的。
Creating an optimized production build...
Failed to compile.
D:/a/1/s/ClientApp/src/App.tsx
TypeScript error in D:/a/1/s/ClientApp/src/App.tsx(20,6):
'Router' cannot be used as a JSX component.
Its instance type 'BrowserRouter' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'React.ReactNode' is not assignable to type 'import("D:/a/1/s/ClientApp/node_modules/react-intl/node_modules/@types/react/index").ReactNode'. TS2786
18 | export default function App() {
19 | return (
> 20 | <Router> …Run Code Online (Sandbox Code Playgroud) 在Office 365 Outlook加载项中,Office.context.mailbox.item.body.getAsync()方法在Outlook Mac中不起作用.但它在safari和chrome中运行良好.
office js参考是" https://appsforoffice.microsoft.com/lib/1/hosted/office.js "
这是加载项阅读应用程序的代码
var _item = Office.context.mailbox.item;
var body = _item.body;
// Get the body asynchronous as text
body.getAsync(Office.CoercionType.Text, function (asyncResult) {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
}
else {
$('#subject').html(asyncResult.value.trim());
}
});
Run Code Online (Sandbox Code Playgroud) 我们如何使用Office 365 JavaScript API在撰写模式下阅读邮件?
如:
Office.initialize = function (reason) {
var body = Office.context.mailbox.item.body;
};
Run Code Online (Sandbox Code Playgroud) Office 应用程序版本可以在清单文件中提及,如下所示
<OfficeApp >
<Version>1.0.0.8</Version>
<OfficeApp >
Run Code Online (Sandbox Code Playgroud)
有没有办法通过office.js获取应用程序版本值
这两种api有什么区别?