focus, _root, getRef - missing from typings
See original GitHub issuereact-native, react and native-base version
- RN
0.55.2 - R
16.3.2 - NB
2.4.2
Expected behaviour
Typings present
Actual behaviour
Typings not present
Steps to reproduce (code snippet or screenshot)
<Input getRef={(input) =>this.passwordInput = input}} />
Type ‘{ getRef: (input: any) => any; }’ has no properties in common with type ‘IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Rea…’.
function focusPassword(input: Input) {
input._root.focus();
}
Property ‘_root’ does not exist on type ‘Input’.
As a result of above focus() is also missing I think but I’m not sure. I see it defined in NativeMethodsMixinStatic but doesn’t seem as if that’s being referenced anywhere
Screenshot of emulator/device
n/a
Is the bug present in both ios and android or in any one of them?
Yes
Any other additional info which would help us debug the issue quicker.
Can be temporarily fixed by adding below typings file to project (focus only actually exists on the value of _root but I don’t know what its meant to be, so I set it to Input)
declare module "native-base" {
// getRef, _root, focus all missing
namespace NativeBase {
interface Input {
focus?: () => void;
_root?: Input;
getRef?: (ref: Input) => void;
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >FAQs | React Hook Form - Simple React forms validation
React Hook Form is focusing on uncontrolled inputs, which means you don't need to change the input value via state via onChange ....
Read more >What do I do when a TypeScript definition file I am using is ...
I notice it is missing the focus method on elements in the array returned by the refs property - so I cannot get...
Read more >React.focus() Code Example - Code Grepper
it is missing from your system. Install or enable PHP's pcntl extension. Root composer.json requires php ^7.2.5 but your php version (8.0.6) does...
Read more >Open Source Used In slido-test 22.06 - Cisco
1.1011 babel-plugin-syntax-typescript 7.14.5 ... 1.1384 focus-visible 5.2.0 ... (For example, a function in a library to compute square roots has.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes,
_rootis still missing@akhil-geekyants would just like to point out that this still isn’t fixed,
_rootremains missing from the types.react-native, react and native-base version
0.60.416.8.62.13.8