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 8 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
5 changes: 4 additions & 1 deletion .eslintignore
Expand Up @@ -7,4 +7,7 @@ content/*
public/*

# Ignore examples
examples/*
examples/*

# Ignore all javascript files in src folder for translation purposes
src/components/*
dummyeuy marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -3,4 +3,5 @@
.idea
node_modules
public
yarn-error.log
yarn-error.log
.vscode
dummyeuy marked this conversation as resolved.
Show resolved Hide resolved
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