Skip to content

Commit

Permalink
add inner hook to the SC example
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jan 22, 2020
1 parent 1cd74e3 commit 5d3eb82
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/styled-components/src/Counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,23 @@ const ComponentB = () => {
);
};

const useSomeHandler = function() {
return 43;
};

function RippleComponent() {
function useRippleHandler() {}
useRippleHandler();
useRippleHandler();

return false;
}

const Counter = ({ children }) => {
const [count, setState] = useState(0);
const useRippleHandler = function() {};
useRippleHandler();
useSomeHandler();
useState(0);
const ref = useRef();
useEffect(() => {
Expand All @@ -43,6 +58,7 @@ const Counter = ({ children }) => {
counter: count,
})}
{count % 2 ? <ComponentA /> : <ComponentB />}
<RippleComponent />
</TimerContext.Provider>
</div>
);
Expand Down

0 comments on commit 5d3eb82

Please sign in to comment.