Skip to content

Commit

Permalink
flush component state when done rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 5, 2021
1 parent df0ede9 commit 04fc7c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/View/Concerns/ManagesComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,15 @@ protected function currentComponent()
{
return count($this->componentStack) - 1;
}

/**
* Flush all of the component state.
*
* @return void
*/
protected function flushComponents()
{
$this->componentStack = [];
$this->componentData = [];
}
}
1 change: 1 addition & 0 deletions src/Illuminate/View/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ public function flushState()

$this->flushSections();
$this->flushStacks();
$this->flushComponents();
}

/**
Expand Down

0 comments on commit 04fc7c2

Please sign in to comment.