如何使用Angular中的反应发表的NPM组件
我创建了简单的React组件,并发布给NPM注册表。它与React的工作正常,但我想在Angular Project中使用相同的插件,其显示以下错误。
插件: https://www.npmjs.coms.coms.com/package/package/reactcustcustcustcustcustcustcustompungin
自定义 到角模块。
npm i reactcustomplugin
AppModule.ts
import SayHello from 'reactcustomplugin';
import { NgModule } from '@angular/core';
@NgModule({
imports: [
SayHello] }) ==> getting below error
,
type'({name}:{name:string;})=>元素'不能分配键入'任何[] |类型| ModulewithProviders< {}>'
I have created simple react component and published to NPM registry. its working fine with react but I want to use same plugin in angular project its showing below error.
Custom plugin : https://www.npmjs.com/package/reactcustomplugin
error while importing plugin to angular module.
npm i reactcustomplugin
appmodule.ts
import SayHello from 'reactcustomplugin';
import { NgModule } from '@angular/core';
@NgModule({
imports: [
SayHello] }) ==> getting below error
,
Type '({ name }: { name: string; }) => Element' is not assignable to type 'any[] | Type | ModuleWithProviders<{}>'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然,您不能使用用react编写的包裹或其他任何内容的包装...
obviously, you can't use the package written in react for angular or anything else ...