Questions tagged [lifecycle]

A sequence of events or system calls relevant to the creation, startup, inactivation, resuming, shutdown and destruction (cleanup) of some program or its component (activity, library, servlet). Lifecycles are supported by various programming platforms.

2000 questions
0
votes
1 answer

Fragments always go through onAttach to onDestroyView, instead of onCreateView to onDestroyView

I am using 4 fragments in 1 activity. The navigation is done via NavDrawer. Every time I navigate through the fragments, each fragment goes through the following methods: onAttach() to onDestroyView() I was expecting them to go through these once…
0
votes
1 answer

It's normal that PUSH events occurs ever twice in Flutter?

I'm trying to understand well the Flutter Lifecycle and I'm not sure that is normal that events like PUSH a view occurs twice. I'm searching for a event that occurs one time only when the view is showed. For example: ViewA is showed…
Luca Panteghini
  • 2,657
  • 3
  • 21
  • 27
0
votes
1 answer

Execute code in React children after parent componentDidMount

I'm using axios for web requests and have created an interceptor for it to show a toaster for all error messages. I'm using react-intl for translations and the generic error message present in the interceptor is translated, so I'm tying the…
vinczemarton
  • 7,756
  • 6
  • 54
  • 86
0
votes
2 answers

Console.log in render method shows state = true, but jsx shows false

I have a list of items which I bring back from an API call in componentDidMount. Each item has a sublist, which I want to render conditionally if the item was clicked (as an accordion). To achieve this, in componentDidMount I setState with a…
0
votes
2 answers

Javascript event catched, but callback function not executing

Two classes listening to one Event. When ClassA gets the event it removes ClassB from DOM and adds it right after it again. The event handlers of ClassB get added and removed by the (dis)connectedCallback functions. ClassB still notices the Event…
Andreas
  • 47
  • 10
0
votes
0 answers

javaFxPorts When I Going back from google map to my app. it start from the beginning. WHY?

In javaFxPorts When I run anther app from my gluon app and go back to my app it start from the beginning and I lose all data that I got it from SQLite :( what is the problem?
0
votes
1 answer

Inheritance of Symfony Lifecycle Callback annotations

I am on Symfony 4, and I have a problem with Lifecycle callbacks. I have two classes, one model and a child of this model. I would like that every child of the model have the same PrePersist callback but the callback is not triggered. Is it normal…
Arcades
  • 150
  • 1
  • 13
0
votes
0 answers

Angular - validating all pages/components on application load

I'm building a loan application site with Angular 7. (think of your usual credit card/home loan application forms. A quick summary of the main features: the application has 7 pages (each with one or more child components) all pages have validations…
0
votes
2 answers

How to hook lifecycle events from root App component in Vue.js

The structure of the app: src/ |-- App.vue |-- components/ |-- MyComponent.vue |-- OtherComponent.vue If I do, in MyComponent.vue // MyComponent.vue export default { name: 'MyComponent', methods: { mounted() { …
Jivan
  • 21,522
  • 15
  • 80
  • 131
0
votes
1 answer

Angular an obj is lost upon page reload

I have a service layer that gets a list of users from an API. Then I list these users on a component and I have a layout to edit with another component. The obj I've selected from the list stays until I reload the page. If I follow the workflow…
Exitl0l
  • 459
  • 2
  • 11
  • 27
0
votes
2 answers

How to properly fetch() JSON in React

I'm trying to fetch some JSON data from a URL. I'm then setting my state to be a portion of that data. In my render method, I'd like to the display that data using map() The issue I'm facing is that because it takes some time to fetch the data, the…
Eli Nathan
  • 1,020
  • 2
  • 13
  • 35
0
votes
1 answer

How to update state when props changes

I have a component Parent, which render a big form. Parent-component has presentational child components Child1 - Child4, which render inputs. When Parent.props are changing, values of Child1 - Child4 should be dropped to default from props. A user…
Anna
  • 31
  • 1
  • 4
0
votes
2 answers

how to start method B() inside onResume() after method A() finished inside onStart()

how to start method B()(main thread) inside onResume() after method A()(work thread) finished inside onStart() I have loadCards() inside onStart(), and initViews() inside onResume(). Need to run initViews() only after loadCards() finished,…
caibirdcnb
  • 275
  • 5
  • 18
0
votes
1 answer

State.dispose() never called

I'm trying to run the AlarmManager when the dispose() method is called. But it looks like dispose() is never called. I don't get any output logs and debuger doesn't break inside this method. When should the dispose() be called. When I hit the…
wirdil
  • 296
  • 3
  • 9
0
votes
2 answers

Nativescript Vue simple example create() mounted() never fire

Following is a very simple Nativescript Vue example from the starter. As it appears below, it displays the list of 5 post titles. So above test is good to start as long as I only use computed to return data to template. However, if I attempt to use…
Locohost
  • 1,682
  • 5
  • 25
  • 38