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.

undefined is not an object (evaluating 'wrapperLayout.pageY)

See original GitHub issue

Hello, I tried to use latest version from master, but unfortunately it doesn’t work. List is rendering correctly, but if I try to drag item I receive an error.

My setup: IPhone 6 (IOS10) or simulator RN 48.3

Code:

<View style={styles.itemInputContainer}>
    <SortableListView
         data={parsedArray}
         order={Object.keys(parsedArray)}
         onRowMoved={console.log}
         renderRow={row => <SortableRow data={row} />}
    />
    <Input
          blurOnSubmit
          style={styles.input}
          onChange={this.handleNewTextInput}
     />
</View>

Sortable row (same code like in examples):

(
    <TouchableHighlight
        underlayColor={'#eee'}
        style={{
            padding: 25,
            backgroundColor: '#F8F8F8',
            borderBottomWidth: 1,
            borderColor: '#eee',
        }}
        {...this.props.sortHandlers}
    >
        <Text>
            {this.props.data.text}
        </Text>
    </TouchableHighlight>
 )

ParsedArray:

const parsedArray = {
    0: {
        text: string
    },
    1: {
        text: string
    },
    ....
}

img_0002 jpg

Issue is related with lines 448-452:

  componentDidMount() {
    InteractionManager.runAfterInteractions(() => {
      setTimeout(this.measureWrapper, 0)
    })
  }

I set debugger inside callback but it was never invoked. Without InteractionManager.runAfterInteractions it’s working as expected.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
rajeshpanwar007commented, Jan 29, 2018

@jpudysz I am facing same issue and also using animation.

How can I fix it ? Please help

0reactions
jpudyszcommented, Jan 29, 2018

@rajeshpanwar007 I was using Animated.loop in the previous screen. What’s more screen with SortableListView was stacked above previous screen, because I was using StackNavigator from react-navigation. I resolved it by finding this edge case and disabling animation somehow (I was calling API and I forgot about stopping animation on catch). I did it with something like this (I’m using TS):

class SomeScreen {
  private animation: Animated.CompositeAnimation

  componentDidMount() {
      this.startAnimation()
      this.fetchData()
  }

  componentWillUpdate(nextProps, nextState) {
     // compare states and disable animation
  }

 componentWillUnmount() {
     if (this.animation) {
       this.animation.stop()
     }
 }

  fetchData() {
     this.props.fetchData()
          .then(data => this.setState({
               data,
               shouldDisableAniamtion: true
          }))
         .catch(() => this.setState({
               shouldDisableAniamtion: true
          }))
  }
  
  startAnimation() {
     this.animation = Animated.loop(/*config*/)
    
     this.animation.start()
  }
}

Your scenario may vary… just watch your Animations on stacked screens and ensure that you will stop them before user will enter screen with SortableListView.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined is not an object (evaluating 'wrapperLayout.pageY')
I'm getting this error in IOS, does anyone know what it can be? No Android is working properly. Edit: My workaround is edit...
Read more >
undefined is not an object (evaluating 'M.layout.force') - Stack ...
I'm new to JSNetworkX. I created a graph using the examples from jsnetworkx.org but I can only log it, I can't display it....
Read more >
Error: undefined is not an object (evaluating 'i.status') when ...
So I'm trying to register a user manually using velo. I followed the documentation pretty closely but I still get this error: Error: ......
Read more >
Undefined is not an object (evaluating 'f.postcount')
Hi, I'm writing you because I have a page where I use the Ajax Load More plugin and I don't know ... Undefined...
Read more >
January TypeError: 'undefined' is not an object (evaluating ...
it says January TypeError: 'undefined' is not an object (evaluating 'console.log("January").substring') and i don't know how to fix that or what is wrong ......
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