Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument 0 (NSNumber) of RCTUIManager.measureLayout must not be null #18

Closed
tonyxiao opened this issue May 20, 2016 · 11 comments
Closed
Labels

Comments

@tonyxiao
Copy link

Getting this error. Any ideas?

image

Src

class ScrollableLoginScreen extends React.Component {
  _scrollToInput (event, reactNode) {
  // Add a 'scroll' ref to your ScrollView
    this.refs.scroll.scrollToFocusedInput(event, reactNode)
  }

  render() {
    return (
      <KeyboardAwareScrollView ref='scroll'>
        <LoginScreen {...this.props} scrollToInput={this._scrollToInput.bind(this)} />
      </KeyboardAwareScrollView>
    )
  }
}
class LoginScreen extends React.Component {
  render() {
    const {fields, handleSubmit, submitting, error, scrollToInput, ...props} = this.props
    return (
      <View style={styles.screen}>
        <StatusBar hidden={false} />
        <View style={styles.modal}>
          <IconTextInput ref='my-input' iconName="envelope-o" placeholder='Email' style={styles.input} {...fields.email} onFocus={scrollToInput} />
          <IconTextInput iconName="lock" placeholder='Password' style={styles.input} {...fields.password} onFocus={scrollToInput} />
          <Button style={theme.BUTTON} styleDisabled={theme.BUTTON_DISABLED} containerStyle={styles.loginButton} 
            disabled={submitting} onPress={handleSubmit}>LOGIN</Button>
          {submitting && <Spinner />}
          {(!submitting && error) && <Text style={theme.TEXT_ERROR}>{error}</Text>}
        </View>
      </View>
    )
  }
}
@fakenickels
Copy link

selection_019
I'm also having something like that running in a real device

@alvaromb
Copy link
Collaborator

The error is due to React being unable to find the node because findNodeHandle doesn't get a React node as a parameter.

If you're using RN 0.26 keep in mind that it's still not supported yet. The code must be changed from React.findNodeHandle to ReactNative.findNodeHandle.

Sorry, will release a compatible version on Monday.

Enviado desde mi iPhone

El 21 may 2016, a las 3:49, Gabriel Rubens notifications@github.com escribió:

I'm also having something like that running in a real device


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@marcosinigaglia
Copy link

I have the same issue using RN 0.25.1

@alvaromb
Copy link
Collaborator

@marcosinigaglia my comment is valid for RN>=0.25.

@adamrainsby
Copy link

@alvaromb I seem to be having the same issue on 0.24.0

@alvaromb
Copy link
Collaborator

Hello!

Please debug the scrollToFocusedInput method. Try to console.log(event, reactNode) because that error usually appears then reactNode is null.

@adamrainsby
Copy link

@alvaromb Yeah that was the problem for me. Thanks

@dnish
Copy link

dnish commented May 30, 2016

Are there any updates on this? I'm having the same issue on 0.25.1

@alvaromb
Copy link
Collaborator

@dnish there's no update. This errors appears when the reactNode sent to the scrollToFocusedInput is null. Please post your code if you need further help. Closing this issue.

@alvaromb
Copy link
Collaborator

Hi everybody!

Once #22 gets merged, we'll no longer need to do this kind of stuff, the component will autoscroll to the focused TextInput.

@fakenickels
Copy link

fakenickels commented May 31, 2016

Thanks man @alvaromb , that feature is really sweet. Things got working here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants