Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How do I connect functionality to material ui tooltips in react typescript app?

$
0
0

I am trying to learn to use react and typescript. However, I am really stuck here.

I am trying to build a counter in the app based on the number of clicks a button gets which is a material ui tooltip. I am not getting how to marry them together(the ui and the logic). So far my code looks like this:

import React,{useState} from 'react';import Tooltip from "@material-ui/core/Tooltip";export const MyCard = () => {const classes = useStyles();return (<Card className={classes.root}><Tooltip title={"Like"}><IconButton aria-label="Like Me"><FavoriteIcon /></IconButton></Tooltip></Card>);

However, I am not sure how to build a counter for the like button based on the number of clicks.Any guidance here would be useful.

Thanks!


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>