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.

Props not being sent to ActionButtonItem

See original GitHub issue

After I pressed the main button, I get a message saying that this.props.anim.interpolate is undefined. After taking a look at the code, I have managed to realize the ActionButtonItem anim props was not set.

It seems like this section of code is not working (inside _renderActions):

{actionButtons.map((ActionButton, idx) => (
        <ActionButtonItem
          key={idx}
          anim={this.anim}
          {...this.props}
          {...ActionButton.props}
          parentSize={this.props.size}
          btnColor={this.props.btnOutRange}
          onPress={() => {
            if (this.props.autoInactive){
              this.timeout = setTimeout(this.reset.bind(this), 200);
            }
            ActionButton.props.onPress();
          }}
        />
      ))}

A log of the ActionButtonItem props shows this:

 { buttonColor: '#9b59b6',
                                                    title: 'New Task',
                                                    onPress: [Function: onPress],
                                                    active: true,
                                                    spaceBetween: 15,
                                                    useNativeFeedback: true,
                                                    activeOpacity: 0.85 }

Which are only the default values.

I cannot possibly find where this issue could be coming from. The props are OK before that map function but the do not appear on the Item itself.

This is Android 5, react native 0.44 and react 0.16-alpha6.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Shuunencommented, Jan 17, 2018

I also have the bug, I don’t understand why this issue is closed…

1reaction
sfratinicommented, Jun 24, 2017

Well, since the ActionItem have a Title, then I guess one use case is to show only text and no icon or label. It was actually what I was trying to do as I didn’t need an icon.

Still the library shouldn’t crash if the Item has no children.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactJS props aren't being passed to other component when ...
This navigation works, however no props are passed (like authMode & username) and the props are always "undefined" in the target/new component, ...
Read more >
react-native-action-button - Bountysource
I wanted to prevent the default behaviour of opening the menu when onPress is triggered (when child items are present) but it seems...
Read more >
invariant violation viewproptypes has been removed - You.com
Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. ERROR Invariant Violation: Module AppRegistry is not a registered callable ...
Read more >
How passing props to component works in React
Props stands for “properties,” and they are used in a React application to send data from one React component to another React component....
Read more >
react-native-action-button: Docs, Community, Tutorials
○2.8.5 (see all)○License:MIT○TypeScript:Not Found○ ... Getting Started with Styled Components | Social Media App UI using Styled ... prop-types ...
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