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.

"mounted" remains false after init

See original GitHub issue

On my project after initialization variable mounted remains false until we trigger some rerendering. Because of this clicking to Arrows leads to instant (0s) transition to destination point. Unfortunately I can not reproduce this behavior on demo page (even by adding react-router). I don’t know why mounter remains false… but do we need this || !mounted condition here?

export const innerStyle = ({ translate, dragging, mounted, transition }) => {
  return {
    ...
    transition: `transform ${dragging || !mounted ? '0' : transition}s`
  };
};

Or, another question: There is setMounted function with variable initialized which is used only in this function. What’s the reason of this variable? Also, setMounted is calling in componentDidUpdate only, shouldn’t we call it in componentDidMount too?

My settings

<ScrollMenu
  data={data}
  arrowLeft={<Arrow type="prev" />}
  arrowRight={<Arrow type="next" />}
  onSelect={this.onSelect}
  wheel={false}
  alignCenter={false}
  wrapperClass={style.sliderInner}
  itemClass={style.sliderItem}
/>

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
asmyshlyaev177commented, Oct 9, 2018

Ok, i published new version.

0reactions
NeXTscommented, Oct 9, 2018

Works now. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

FlutterError (setState() called after dispose(): (lifecycle state
Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree....
Read more >
init fail to work when mounting /dev · Issue #14251 - GitHub
I doubt that just adding the /dev/init mount after the /dev:/dev mount will work for rootless. Is there any reason why the path...
Read more >
Options: Lifecycle | Vue.js
A component is considered mounted after: All of its synchronous child components have been mounted (does not include async components or components inside ......
Read more >
Lifecycle hooks - Angular
A component instance has a lifecycle that starts when Angular instantiates the component class and renders the component view along with its child...
Read more >
How to fix boot failure due to incorrect fstab?
It seems that I've found a solution: At the GRUB prompt, hit A to append options. Add init=/bin/bash to the end of the...
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