From 74bd2a4c628031d6619ed338b5793caa54c66a98 Mon Sep 17 00:00:00 2001 From: "visual.indi" <7021685+indivisualvj@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:54:08 +0100 Subject: [PATCH] Corrected Wrong Information In fact, as also described here: https://stimulus.hotwired.dev/reference/lifecycle-callbacks#targets [name]TargetConnected callbacks are already executed after initialize() --- docs/reference/targets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/targets.md b/docs/reference/targets.md index 2c4a1b20..a4fef836 100644 --- a/docs/reference/targets.md +++ b/docs/reference/targets.md @@ -95,7 +95,7 @@ removed within the controller's element. Define a method `[name]TargetConnected` or `[name]TargetDisconnected` in the controller, where `[name]` is the name of the target you want to observe for additions or removals. The method receives the element as the first argument. -Stimulus invokes each element callback any time its target elements are added or removed after `connect()` and before `disconnect()` lifecycle hooks. +Stimulus invokes each element callback any time its target elements are added or removed after `initialize()` and before `disconnect()` lifecycle hooks. ```js export default class extends Controller {