Skip to content

Commit 5d3eb82

Browse files
committed
add inner hook to the SC example
1 parent 1cd74e3 commit 5d3eb82

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/styled-components/src/Counter.js

+16
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,23 @@ const ComponentB = () => {
2424
);
2525
};
2626

27+
const useSomeHandler = function() {
28+
return 43;
29+
};
30+
31+
function RippleComponent() {
32+
function useRippleHandler() {}
33+
useRippleHandler();
34+
useRippleHandler();
35+
36+
return false;
37+
}
38+
2739
const Counter = ({ children }) => {
2840
const [count, setState] = useState(0);
41+
const useRippleHandler = function() {};
42+
useRippleHandler();
43+
useSomeHandler();
2944
useState(0);
3045
const ref = useRef();
3146
useEffect(() => {
@@ -43,6 +58,7 @@ const Counter = ({ children }) => {
4358
counter: count,
4459
})}
4560
{count % 2 ? <ComponentA /> : <ComponentB />}
61+
<RippleComponent />
4662
</TimerContext.Provider>
4763
</div>
4864
);

0 commit comments

Comments
 (0)