From 0c6a26ff9e86fa0631db1a15f5235485241ec6ab Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 12 Dec 2018 13:57:15 -0700 Subject: [PATCH] Hooks proposal has been accepted (#1485) --- content/docs/hooks-custom.md | 4 ++-- content/docs/hooks-effect.md | 2 +- content/docs/hooks-faq.md | 2 +- content/docs/hooks-intro.md | 2 +- content/docs/hooks-overview.md | 6 +++--- content/docs/hooks-reference.md | 2 +- content/docs/hooks-rules.md | 2 +- content/docs/hooks-state.md | 6 +++--- content/docs/nav.yml | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/content/docs/hooks-custom.md b/content/docs/hooks-custom.md index 72a2a6c3..4da45d5e 100644 --- a/content/docs/hooks-custom.md +++ b/content/docs/hooks-custom.md @@ -6,7 +6,7 @@ next: hooks-reference.html prev: hooks-rules.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. Building your own Hooks lets you extract component logic into reusable functions. @@ -103,7 +103,7 @@ The purpose of our `useFriendStatus` Hook is to subscribe us to a friend's statu ```js function useFriendStatus(friendID) { const [isOnline, setIsOnline] = useState(null); - + // ... return isOnline; diff --git a/content/docs/hooks-effect.md b/content/docs/hooks-effect.md index a9d13da4..2c40a128 100644 --- a/content/docs/hooks-effect.md +++ b/content/docs/hooks-effect.md @@ -6,7 +6,7 @@ next: hooks-rules.html prev: hooks-intro.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. The *Effect Hook* lets you perform side effects in function components: diff --git a/content/docs/hooks-faq.md b/content/docs/hooks-faq.md index aa6fcc30..903dc50b 100644 --- a/content/docs/hooks-faq.md +++ b/content/docs/hooks-faq.md @@ -5,7 +5,7 @@ permalink: docs/hooks-faq.html prev: hooks-reference.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. This page answers some of the frequently asked questions about [Hooks](/docs/hooks-overview.html). diff --git a/content/docs/hooks-intro.md b/content/docs/hooks-intro.md index 18bd4af7..e2718832 100644 --- a/content/docs/hooks-intro.md +++ b/content/docs/hooks-intro.md @@ -5,7 +5,7 @@ permalink: docs/hooks-intro.html next: hooks-overview.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. ```js{4,5} import { useState } from 'react'; diff --git a/content/docs/hooks-overview.md b/content/docs/hooks-overview.md index 72911888..f83da65e 100644 --- a/content/docs/hooks-overview.md +++ b/content/docs/hooks-overview.md @@ -6,7 +6,7 @@ next: hooks-state.html prev: hooks-intro.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. Hooks are [backwards-compatible](/docs/hooks-intro.html#no-breaking-changes). This page provides an overview of Hooks for experienced React users. @@ -251,7 +251,7 @@ function Example() { const theme = useContext(ThemeContext); // ... } -``` +``` And [`useReducer`](/docs/hooks-reference.html#usereducer) lets you manage local state of complex components with a reducer: @@ -259,7 +259,7 @@ And [`useReducer`](/docs/hooks-reference.html#usereducer) lets you manage local function Todos() { const [todos, dispatch] = useReducer(todosReducer); // ... -``` +``` >Detailed Explanation > diff --git a/content/docs/hooks-reference.md b/content/docs/hooks-reference.md index 9d093acf..a8e75a09 100644 --- a/content/docs/hooks-reference.md +++ b/content/docs/hooks-reference.md @@ -6,7 +6,7 @@ prev: hooks-custom.html next: hooks-faq.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. This page describes the APIs for the built-in Hooks in React. diff --git a/content/docs/hooks-rules.md b/content/docs/hooks-rules.md index 731f619a..b393e4d8 100644 --- a/content/docs/hooks-rules.md +++ b/content/docs/hooks-rules.md @@ -6,7 +6,7 @@ next: hooks-custom.html prev: hooks-effect.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. Hooks are JavaScript functions, but you need to follow two rules when using them. We provide a [linter plugin](https://www.npmjs.com/package/eslint-plugin-react-hooks) to enforce these rules automatically: diff --git a/content/docs/hooks-state.md b/content/docs/hooks-state.md index 72cdad8a..da0caeb4 100644 --- a/content/docs/hooks-state.md +++ b/content/docs/hooks-state.md @@ -6,7 +6,7 @@ next: hooks-effect.html prev: hooks-overview.html --- -*Hooks* are a new feature proposal that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha and being discussed in [an open RFC](https://github.com/reactjs/rfcs/pull/68). +*Hooks* are an upcoming feature that lets you use state and other React features without writing a class. They're currently in React v16.7.0-alpha. The [previous page](/docs/hooks-intro.html) introduced Hooks with this example: @@ -197,7 +197,7 @@ Let's now **recap what we learned line by line** and check our understanding. --> ```js{1,4,9} 1: import { useState } from 'react'; - 2: + 2: 3: function Example() { 4: const [count, setCount] = useState(0); 5: @@ -273,7 +273,7 @@ We provide more recommendations on splitting independent state variables [in the ## Next Steps -On this page we've learned about one of the Hooks provided by React, called `useState`. We're also sometimes going to refer to it as the "State Hook". It lets us add local state to React function components -- which we did for the first time ever! +On this page we've learned about one of the Hooks provided by React, called `useState`. We're also sometimes going to refer to it as the "State Hook". It lets us add local state to React function components -- which we did for the first time ever! We also learned a little bit more about what Hooks are. Hooks are functions that let you "hook into" React features from function components. Their names always start with `use`, and there are more Hooks we haven't seen yet. diff --git a/content/docs/nav.yml b/content/docs/nav.yml index 35a6b817..01f5942a 100644 --- a/content/docs/nav.yml +++ b/content/docs/nav.yml @@ -104,7 +104,7 @@ title: JS Environment Requirements - id: glossary title: Glossary -- title: Hooks (Proposal) +- title: Hooks (Preview) isOrdered: true items: - id: hooks-intro