Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate JSX In-Depth #125

Merged
merged 12 commits into from Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,3 +1,4 @@

node_modules/*

# Ignore markdown files and examples
Expand Down
8 changes: 5 additions & 3 deletions content/docs/hooks-faq.md
Expand Up @@ -109,7 +109,9 @@ You can continue to use the exact same APIs as you always have; they'll continue

React Redux since v7.1.0 [supports Hooks API](https://react-redux.js.org/api/hooks) and exposes hooks like `useDispatch` or `useSelector`.

Libraries like React Router might support hooks in the future.
React Router [supports hooks](https://reacttraining.com/react-router/web/api/Hooks) since v5.1.

Other libraries might support hooks in the future too.

### Do Hooks work with static typing? {#do-hooks-work-with-static-typing}

Expand Down Expand Up @@ -371,7 +373,7 @@ Note how this would work for props, state, or any other calculated value.
function Counter() {
const [count, setCount] = useState(0);

const calculation = count * 100;
const calculation = count + 100;
const prevCalculation = usePrevious(calculation);
// ...
```
Expand Down Expand Up @@ -655,7 +657,7 @@ function ProductPage({ productId }) {
return <ProductDetails fetchProduct={fetchProduct} />;
}

function ProductDetails({ fetchProduct })
function ProductDetails({ fetchProduct }) {
useEffect(() => {
fetchProduct();
}, [fetchProduct]); // ✅ All useEffect dependencies are specified
Expand Down