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.

Accessing the $parent properties and functions from the child init() no longer works in 1.0.0

See original GitHub issue

Accessing properties and functions from $parent in the child init() function works in version 0.6.0. It no longer works in 1.0.0 so this might be a regression.

0.6.0 (works) : https://codepen.io/pomartel/pen/jOVaZKX 1.0.0 (broken): https://codepen.io/pomartel/pen/bGBYLmx

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
SimoTodcommented, Feb 23, 2021

It will always work, requestAnimationFrame would work as well. It just needs to release the main thread of execution so the parent can carry on. Js is single threaded, setTimeout is just a close match. By the time it gets the control back, parent will be fully available. I’ll keep you posted if we can make it work again, keeping the enhanced functionalities. If we can’t do anything, we’ll need to mention it in the doc for other developers.

0reactions
pomartelcommented, Feb 24, 2021

Great, thanks for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - trying to use child component function in parent view ...
When I use @ViewChildren I get the error that the function from that component is not a function. I am new to using...
Read more >
Spring Boot Reference Documentation
Typically, your Maven POM file inherits from the spring-boot-starter-parent project and declares dependencies to one or more “Starters”.
Read more >
Python Inheritance - W3Schools
Python Inheritance. Inheritance allows us to define a class that inherits all the methods and properties from another class. Parent class is the...
Read more >
API Reference - Roact Documentation
Creates a Roblox Instance given a Roact element, and optionally a parent to ... If children contains more than one child, oneChild function...
Read more >
Groovy Language Documentation
A touch of formalism; Benefits of monoids; Working with Non-monoids ... Parent classes share visible fields, properties or methods with child classes.
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