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.

Parameter of action is undefined when logged

See original GitHub issue

Welcome to MobX. Please provide as much relevant information as possible!

I have a:

  1. Question: Feel free to just state your question. For a quick answer, there are usually people online at our Gitter channel

I have an input text component and I use a mobX action to update it’s value. However, when I log the action parameter which is the new value of the the input text I get undefined.

Here’s my action code:

    updateStartingLettersText = action((changedText) => {
        reactotron.logImportant('changed text is : ', changedText) //prints changed text is undefined
        this.startingLettersText= changedText
    })

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
urugatorcommented, Feb 8, 2019

onChangeText={() => this.onStartingLettersTextChanged()} => onChangeText={this.onStartingLettersTextChanged}

0reactions
lock[bot]commented, Jul 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Why is the parameter inside the action coming ...
Right now, you're not passing the resultId , hence it is passed as undefined . const mapDispatchToProps = (dispatch) => { return { ......
Read more >
A parameter to an Aura Action is undefined. But not always ...
I have a particularly strange issue where one, and only one parameter to an Aura Action is undefined. Worse, it seems to be...
Read more >
Actions and reducers: updating state - Human Redux
In Redux all changes to the application state happen via an "action. ... we call it without arguments // it prints out 0...
Read more >
Connect: Extracting Data with mapStateToProps - React Redux
As the first argument passed in to connect , mapStateToProps is used for ... pass null or undefined to connect in place of...
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
undefined is a property of the global object. That is, it is a variable in global scope. In all non-legacy browsers, undefined is...
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