Skip to content

Commit aea14d3

Browse files
committed
Update React recipe
1 parent 02203cf commit aea14d3

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

app/cookbook/migrate-from-react.md app/cookbook/translate-react.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: A React Developers Guide to Writing Enhance Components
2+
title: Translate React syntax to Enhance elements
33
---
44

5-
Frequently, we are asked by React developers why patterns they have learned while writing components using JSX do not translate to writing web components. In this doc, we'll describe some common gotchas that developers coming from React or other JavaScript frameworks may run into when writing plain vanilla web components.
5+
We’re often asked by React developers why patterns they’ve learned while writing JSX don’t translate to writing web components. In this doc, well describe some common gotchas that developers coming from React or other JavaScript frameworks may run into when writing plain vanilla web components.
66

77
## String Interpolation
88

@@ -81,4 +81,4 @@ const todoList = <ul>
8181

8282
</code-compare>
8383

84-
For a more verbose description on the differences between Enhance and React components [read this post](https://begin.com/blog/posts/2024-03-08-a-react-developers-guide-to-writing-enhance-components).
84+
For a more in depth look at the differences between Enhance and React components, [read this post on the Begin blog](https://begin.com/blog/posts/2024-03-08-a-react-developers-guide-to-writing-enhance-components).

app/elements/code-compare.mjs

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ export default function CodeCompare ({ html }) {
33
<style>
44
:host {
55
display: grid;
6-
grid-template-columns: repeat(2, 1fr);
6+
grid-template-columns: 1fr;
77
grid-template-rows: 1fr;
88
gap: var(--space-0);
99
width: 100%;
1010
}
11+
12+
@media (width >= 56em) {
13+
:host {
14+
grid-template-columns: repeat(2, 1fr);
15+
}
16+
}
1117
</style>
1218
<slot></slot>
1319
`

app/elements/cookbook/recipes.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export default function CookbookRecipes ({ html }) {
3737
</p>
3838
</cookbook-recipe-card>
3939
40-
<cookbook-recipe-card name="A React Developers Guide to Writing Enhance Components" href="/cookbook/migrate-from-react">
40+
<cookbook-recipe-card name="Translate React syntax to Enhance elements" href="/cookbook/translate-react">
4141
<p slot="description">
42-
Learn how to migrate your React app to an Enhance app.
42+
Watch out for common gotchas when coming from React and JSX.
4343
</p>
4444
</cookbook-recipe-card>
4545

0 commit comments

Comments
 (0)