ReactTraining / react-history

Manage session history with React
266 stars 23 forks source link

Add <Prompt when> #4

Closed mjackson closed 8 years ago

mjackson commented 8 years ago

The <Prompt when> prop makes the prompt active only when its value is true. So instead of doing this:

{condition && <Prompt ...>}

users can do this:

<Prompt when={condition} ...>

and avoid the conditional rendering.