[英]Native Base: how to find source code of <Input>?
I'm using the <Input>
component from Native Base
in my React Native app.我在我的 React Native 应用程序中使用来自
Native Base
的<Input>
组件。
I want to find the source code, so I looked in node_modules/native-base/src/index.js
and it has a line that says import { Input } from './basic/Input';
我想找到源代码,所以我查看了
node_modules/native-base/src/index.js
,它有一行写着import { Input } from './basic/Input';
. . So I went to
node_modules/native-base/src/basic/Input.js
.所以我去了
node_modules/native-base/src/basic/Input.js
。 I tried editing this file in order to see whether it affected the Input
I had have rendered in my app, and thus confirm whether this is the correct source file.我尝试编辑此文件以查看它是否影响了我在应用程序中呈现的
Input
,从而确认这是否是正确的源文件。 Nothing changed anything;什么都没有改变; even when I commented out the entire
Input.js
file, nothing changed.即使我注释掉了整个
Input.js
文件,也没有任何改变。
Where did I go wrong here, and how should I approach finding this file?我在哪里 go 错了,我应该如何找到这个文件?
*render() {
const { input, meta, ...inputProps } = this.props;
return (
<InputGroup underline>
<Input
onChangeText={input.onChange}
onBlur={input.onBlur}
onFocus={input.onFocus}
value={input.value}
{...inputProps}
/>
</InputGroup>
);
}*
If you wanted to check the source code, then checkout如果您想查看源代码,请查看
If you want to update the files in your node_modules
, you need to know a few things如果你想更新
node_modules
中的文件,你需要知道一些事情
node_modules/native-base/src
should be the last place you should visit.node_modules/native-base/src
应该是您应该访问的最后一个地方。 Because bundlers usually don't look into this.node_modules/native-base/lib/module/components/primitives/Input/Input.tsx
node_modules/native-base/lib/commonjs/components/primitives/Input/Input.tsx
node_modules/native-base/lib/module/components/primitives/Input/Input.tsx
node_modules/native-base/lib/commonjs/components/primitives/Input/Input.tsx
NOTE: My answer is based on the assumption you're NativeBase version 3.x
.注意:我的回答是基于您是 NativeBase 版本
3.x
的假设。 For 2.x
file path may change a little.对于
2.x
文件路径可能会稍有变化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.