Reactjs 从npm调试组件
所以我从npm下载了一个名为AwesomeButton的组件,我想调试这个组件Reactjs 从npm调试组件,reactjs,Reactjs,所以我从npm下载了一个名为AwesomeButton的组件,我想调试这个组件 import React, {Component} from 'react'; import { AwesomeButtonProgress } from "react-awesome-button"; import "react-awesome-button/dist/styles.css"; 试图打开index.d.ts文件,该文件包含按钮引用,但代码与此类似,没有包含所
import React, {Component} from 'react';
import { AwesomeButtonProgress } from "react-awesome-button";
import "react-awesome-button/dist/styles.css";
试图打开index.d.ts文件,该文件包含按钮
引用,但代码与此类似,没有包含所有函数的类
declare module 'react-awesome-button' {
import React, { Component } from 'react';
export interface AwesomeButtonProps {
action?(): void;
active: boolean;
blocked: boolean;
children: React.ReactNode;
className: string;
cssModule: object;
disabled: boolean;
element?(): void;
href: string;
moveEvents: boolean;
onPress?(): void;
onReleased?(): void;
placeholder: boolean;
ripple: boolean;
rootElement: string;
size: string;
style: object;
target: string;
title: string;
to: string;
type: string;
visible: boolean;
}
export default class AwesomeButton extends Component<
AwesomeButtonProps,
{}
> {}
export interface AwesomeButtonProgressProps {
action?(): void;
children: React.ReactNode;
cssModule: object;
disabled: boolean;
fakePress: boolean;
loadingLabel: string;
onPress?(): void;
releaseDelay: number;
resultLabel: string;
rootElement: React.ReactNode;
size: string;
type: string;
}
export default class AwesomeButtonProgress extends Component<
AwesomeButtonProgressProps,
{}
> {}
export interface AwesomeButtonSocialProps {
action?(): void;
children: React.ReactNode;
disabled: boolean;
href: string;
icon: boolean;
iconHeight: number;
iconWidth: number;
image: string;
message: string;
onPress?(): void;
phone: string;
type: string;
url: string;
user: string;
}
export default class AwesomeButtonSocial extends Component<
AwesomeButtonSocialProps,
{}
> {}
}
声明模块'react awesome button'{
从“React”导入React,{Component};
导出接口awesomeButtonPops{
作用?():无效;
活动:布尔值;
分块:布尔;
子节点:React.ReactNode;
类名:string;
cssModule:对象;
禁用:布尔值;
元素?():空;
href:string;
moveEvents:布尔型;
onPress?():无效;
onReleased?():无效;
占位符:布尔;
涟漪:布尔;
根元素:字符串;
大小:字符串;
风格:对象;
目标:字符串;
标题:字符串;
到:字符串;
类型:字符串;
可见:布尔;
}
导出默认类AwesomeButton扩展组件<
令人敬畏的按钮,
{}
> {}
导出接口AwesomeButtonProgressProps{
作用?():无效;
子节点:React.ReactNode;
cssModule:对象;
禁用:布尔值;
伪压:布尔型;
加载标签:字符串;
onPress?():无效;
释放延迟:数字;
结果标签:字符串;
根元素:React.ReactNode;
大小:字符串;
类型:字符串;
}
导出默认类AwesomeButtonProgress扩展组件<
令人敬畏的按钮PropressProps,
{}
> {}
导出接口AwesomeButtonSocialProps{
作用?():无效;
子节点:React.ReactNode;
禁用:布尔值;
href:string;
图标:布尔;
iconHeight:数字;
iconWidth:数字;
图像:字符串;
消息:字符串;
onPress?():无效;
电话:字符串;
类型:字符串;
url:string;
用户:字符串;
}
导出默认类AwesomeButtonSocial扩展组件<
令人敬畏的按钮社交按钮,
{}
> {}
}
我想知道组件类在哪里,以便调试代码。模块的代码都位于node_modules文件夹中。如果您想直接进入该类的代码,只需按住Control键并单击类名即可 文件index.d.ts只是Typescript使用的“键入”文件