question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: null is not an object (evaluating '_ref.props')

See original GitHub issue

Environment

iOS 14.3
React-Native: 62.2.0
react-native-community/viewpager: ^5.0.11

Description

I am rendering a simple ViewPager component that is throwing this error on the iOS simulator.

TypeError: null is not an object (evaluating '_ref.props')

Reproducible Demo

const RenderViewPage = () => {
let pager = React.createRef();
let activeSlide = 0;
  return (
          <ViewPager
            requestAnimationFrame={() => pager.current?.setPage(activeSlide)}
            ref={pager}
            onPageSelected={(e) => setActiveSlide(e.nativeEvent.position)}
            orientation="vertical"
            style={{
              height: Metrics.screenHeight,
              width: Metrics.screenWidth
            }}
            initialPage={0}>
         <View></View>
  </ViewPager>
  )
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
troZeecommented, Mar 9, 2021
0reactions
arihantopcommented, Dec 23, 2022

why i still meet this crash??

try adding if(!child){ return} in utils.tsx file of this library in node_modules

Read more comments on GitHub >

github_iconTop Results From Across the Web

ref prop is not passed, TypeError: null is not an object ...
The ref is not inside of props . When using ref as a prop, the FunctionComponents should be created with forwardRef() which takes...
Read more >
How to Fix TypeError: Null is Not an Object in JavaScript
The JavaScript error TypeError: null is not an object occurs when a property is accessed or a method is called on a null...
Read more >
TypeError: null is not an object - Laracasts
Currently I get an error of "TypeError: null is not an object (evaluating 'this.booking.id')" .
Read more >
null is not an object (evaluating 'inputRef.current.focus')-React ...
Coding example for the question ref prop is not passed, TypeError: null is not an object (evaluating 'inputRef.current.focus')-React Native.
Read more >
I get this typeerror:null is not an object(evaluating scene.props)
I get this typeerror:null is not an object(evaluating scene.props) · Move data fetching code or side effects to componentDidUpdate. · If you're ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found