From b47e2d77c5bc15b403e76664ba47f2566838327c Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 27 Oct 2016 13:06:09 +0100 Subject: [PATCH] Consistent CodePen links in docs --- docs/conditional-rendering.md | 6 +++--- docs/forms.md | 8 ++++---- docs/lists-and-keys.md | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/conditional-rendering.md b/docs/conditional-rendering.md index 865f124a..cb120a89 100644 --- a/docs/conditional-rendering.md +++ b/docs/conditional-rendering.md @@ -42,7 +42,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/ZpVxNq?editors=0011) +[Try it on CodePen.](https://codepen.io/gaearon/pen/ZpVxNq?editors=0011) This example renders a different greeting depending on the value of `isLoggedIn` prop. @@ -116,7 +116,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/QKzAgB?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/QKzAgB?editors=0010) While declaring a variable and using an `if` statement is a fine way to conditionally render a component, sometimes you might want to use a shorter syntax. There are a few ways to inline conditions in JSX, explained below. @@ -238,4 +238,4 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/Xjoqwm?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/Xjoqwm?editors=0010) diff --git a/docs/forms.md b/docs/forms.md index df1c0997..0d92ec6d 100644 --- a/docs/forms.md +++ b/docs/forms.md @@ -302,7 +302,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/JRVaYB?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/JRVaYB?editors=0010) ### Controlled Textarea @@ -346,7 +346,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/NRmLxN?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/NRmLxN?editors=0010) ### Controlled Select @@ -389,7 +389,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/qawrbr?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/qawrbr?editors=0010) ### Uncontrolled Radio Button @@ -456,7 +456,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/ozOPLJ?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/ozOPLJ?editors=0010) ### Uncontrolled Checkbox diff --git a/docs/lists-and-keys.md b/docs/lists-and-keys.md index 14a346f6..c2b15270 100644 --- a/docs/lists-and-keys.md +++ b/docs/lists-and-keys.md @@ -42,7 +42,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/GjPyQr?editors=0011) +[Try it on CodePen.](https://codepen.io/gaearon/pen/GjPyQr?editors=0011) This code displays a bullet list of numbers between 1 and 5. @@ -94,7 +94,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/jrXYRR?editors=0011) +[Try it on CodePen.](https://codepen.io/gaearon/pen/jrXYRR?editors=0011) ## Keys @@ -200,7 +200,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/rthor/pen/QKzJKG?editors=0010) +[Try it on CodePen.](https://codepen.io/rthor/pen/QKzJKG?editors=0010) A good rule of thumb is that elements inside the `map()` call need keys. @@ -244,7 +244,7 @@ ReactDOM.render( ); ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/NRZYGN?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/NRZYGN?editors=0010) Keys serve as a hint to React but they don't get passed to your components. If you need the same value in your component, pass it explicitly as a prop with a different name: @@ -294,6 +294,6 @@ function NumberList(props) { } ``` -[Try it out on CodePen.](https://codepen.io/gaearon/pen/BLvYrB?editors=0010) +[Try it on CodePen.](https://codepen.io/gaearon/pen/BLvYrB?editors=0010) Sometimes this results in clearer code, but this style can also be abused. Like in JavaScript, it is up to you to decide whether it is worth extracting a variable for readability. Keep in mind that if the `map()` body is too nested, it might be a good time to [extract a component](/react/docs/components-and-props.html#extracting-components).