-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rendering): remove render instructions from slot expressions (#10747
- Loading branch information
Showing
7 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro": patch | ||
--- | ||
|
||
Fixes an issue where functions could not be used as named slots. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/astro/test/fixtures/astro-slots/src/components/FunctionsToAPI.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
const content = 'Test Content'; | ||
const beforeConent = await Astro.slots.render("before", [{content}]) | ||
const afterConent = await Astro.slots.render("after", [{content}]) | ||
--- | ||
<div id="before"> | ||
{beforeConent} | ||
</div> | ||
<div id="after"> | ||
{afterConent} | ||
</div> | ||
|
11 changes: 11 additions & 0 deletions
11
packages/astro/test/fixtures/astro-slots/src/pages/slotted-named-functions.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import Field from '../components/FunctionsToAPI.astro' | ||
--- | ||
<Field> | ||
<div slot="before"> | ||
{({content}) => <div>{content} BEFORE</div>} | ||
</div> | ||
<div slot="after"> | ||
{({content}) => <div>{content} AFTER</div>} | ||
</div> | ||
</Field> |