react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

Possibility to use material-ui/core makeStyles function to create styles for MentionsInput

Open alessio-de-padova opened this issue 3 years ago • 0 comments

I would like to use material-ui's function makeStyles as shown here below:

const useStyles = makeStyles((theme) => ({
    control: {
        backgroundColor: '#fff',
        fontSize: 20,
        fontWeight: 'normal',
 
    },
}));

 const classes = useStyles();
    return (
        <MentionsInput
            value={props.value}
            fullWidth
            onChange={props.onChange}
            placeholder={props.placeholder}
            style={classes}
            allowSuggestionsAboveCursor
        >
            <Mention
                trigger='@'
                data={props.suggestions}
                className="mentions__mention"
            />
        </MentionsInput>
    )

So that I can use theme variables to change colors and stuff. Right now, it seems we are not able to do that. Of course, it works without using makeStyles but we would lose the ability to adjustmentionsInput styles on theme changes

alessio-de-padova avatar Dec 13 '21 11:12 alessio-de-padova