Skip to content

Commit

Permalink
chore: clarify comment in hooks demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Oct 28, 2021
1 parent 1670b4e commit 268e6d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions demo/src/Compat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ import React, { useMemo, useState } from "react";
export function ReactComponent() {
const [v, set] = useState(0);

// NOTE: Test that babel-plugin-transform-hook-names can process this as well.
// NOTE: To check in devtools that babel-plugin-transform-hook-names can
// extract the variable names from typed expressions.
const _unusedState = useState(0 as any);
const _unusedMemo = useMemo<number>(() => _unusedState[0], [_unusedState[0]]);
const _unusedMemo: number = useMemo<number>(
() => _unusedState[0],
[_unusedState[0]],
);

return (
<div>
Expand Down

0 comments on commit 268e6d6

Please sign in to comment.