From 0c9558e33c5ea5491e4cdc0bf9cc25d0d58ae5d3 Mon Sep 17 00:00:00 2001 From: Ashrene-Roy Date: Sat, 10 Dec 2022 22:16:13 +0530 Subject: [PATCH] [beta] Fix chai recipe in docs --- beta/src/content/learn/keeping-components-pure.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/beta/src/content/learn/keeping-components-pure.md b/beta/src/content/learn/keeping-components-pure.md index f3096115c37..781e9f661de 100644 --- a/beta/src/content/learn/keeping-components-pure.md +++ b/beta/src/content/learn/keeping-components-pure.md @@ -53,9 +53,12 @@ React is designed around this concept. **React assumes that every component you function Recipe({ drinkers }) { return (
    -
  1. Boil {drinkers} cups of milk.
  2. -
  3. Add {2 * drinkers} spoons of masala spices.
  4. -
  5. Remove from heat, and add {drinkers} spoons of tea.
  6. +
  7. Boil {drinkers} cups of water.
  8. +
  9. Add {drinkers} spoons of tea and boil till color darkens. +
  10. +
  11. Add {0.5 * drinkers} spoons of masala spices.
  12. +
  13. Add {0.5 * drinkers} cups of milk and bring to boil again.
  14. +
  15. Remove from heat and add sugar to taste.
); } @@ -75,15 +78,15 @@ export default function App() { -When you pass `drinkers={1}` to `Recipe`, it will return JSX containing `1 cups of milk`. Always. +When you pass `drinkers={1}` to `Recipe`, it will return JSX containing `1 cups of water`. Always. -If you pass `drinkers={4}`, it will return JSX containing `4 cups of milk`. Always. +If you pass `drinkers={4}`, it will return JSX containing `4 cups of water`. Always. Just like a math formula. You could think of your components as recipes: if you follow them and don't introduce new ingredients during the cooking process, you will get the same dish every time. That "dish" is the JSX that the component serves to React to [render.](/learn/render-and-commit) - + ## Side Effects: (un)intended consequences {/*side-effects-unintended-consequences*/}