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.

Error: undefined is not a function (evaluating 'UIManager.setChildren(containerTag,createdTags)')

See original GitHub issue

Environment:

  • react-native 0.26.0-rc
  • react 15.0.2
  • Android 5.1.1 API 22
  • Mac OSX 10.11.14

Issue: When running my app (in dev mode), I am getting the following error:

E/ReactNativeJS: undefined is not a function (evaluating ‘UIManager.setChildren(containerTag,createdTags)’)

All attempts at debugging have failed on my part. The Android app contains both native and react-native code, but I currently have no NativeModules or Views - just an Activity whose onCreate is:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Fabric.with(this, new Crashlytics(), new CrashlyticsNdk());
        mReactRootView = new ReactRootView(this);
        mReactInstanceManager = ReactInstanceManager.builder()
                .setApplication(getApplication())
                .setBundleAssetName("index.android.bundle")
                .setJSMainModuleName("index.android")
                .addPackage(new MainReactPackage())
                .setUseDeveloperSupport(BuildConfig.DEBUG)
                .setInitialLifecycleState(LifecycleState.RESUMED)
                .build();
        mReactRootView.startReactApplication(mReactInstanceManager, "Insights");
        setContentView(mReactRootView);
    }

I’ve attached a screenshot of the emulator:

screen shot 2016-05-05 at 12 01 10 pm

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
tuckerconnellycommented, May 25, 2016

Yeah getting this too after upgrading to 0.26.2. I got a temporary workaround by re-adding the deleted code from UIManager.js

if (!UIManager.setChildren) {

  /**
   * Index cache (used by setChildren())
   */
  UIManager._cachedIndexArray = function(size) {
    var cachedResult = this._cachedIndexArray._cache[size];
    if (!cachedResult) {
      var arr = [];
      for (var i = 0; i < size; i++) {
        arr[i] = i;
      }
      this._cachedIndexArray._cache[size] = arr;
      return arr;
    } else {
      return cachedResult;
    }
  };
  UIManager._cachedIndexArray._cache = {};

  /**
   * Fallback setChildren() implementation for Android
   */
  UIManager.setChildren = function(containerTag, createdTags) {
    var indexes = this._cachedIndexArray(createdTags.length);
    UIManager.manageChildren(containerTag, null, null, createdTags, indexes, null);
  };
}
1reaction
MerlinYucommented, Jun 13, 2016

I think react-native version is not stable. When I want to develop with android ,there are many problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined is not a function (evaluating this.function() in react ...
The problem is that I keep getting the error 'undefined is not a function (evaluating ...)'. Im kinda new to javascript and couldn't...
Read more >
TypeError: undefined is not a function - JavaScript - SitePoint
It works fine but in iphone, which displays this error: TypeError: undefined is not a function (evaluating 'ulist.prepend(newItem)').
Read more >
TypeError: 'undefined' is not an object (evaluating 'section ...
There was an error with your code: TypeError: 'undefined' is not an object (evaluating 'section.addEventListene. What am I doing 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