#How do I make a notification show when a button is clicked?

5 messages ยท Page 1 of 1 (latest)

torpid zealot
#

Everything I have tried does not work. I am also new to React.

plucky chasm
#

You can call the showNotification function on click, it makes it easier. Without seeing your code it's a bit hard to help, though.

torpid zealot
#

This is my whole app or whatever ```jsx
return (
<MantineProvider>
<TypographyStylesProvider>
<Title align="center" order={1}>
Discounter
</Title>

    <Stack align="center" spacing="xs">
      <NumberInput
        mt="xl"
        label="Price"
        description="The price of the product / item"
        placeholder="Enter a number"
        withAsterisk
        icon={<IconTag size={18} />}
      />

      <NumberInput
        mt="xl"
        label="Discount"
        description="Percent to discount off of the price"
        placeholder="Enter a percentage"
        withAsterisk
        icon={<IconPercentage size={18} />}
      />

      <Group>
        <Button onClick={() => {}}>Calculate</Button>
        <Button variant="light">Clear</Button>
      </Group>
    </Stack>
  </TypographyStylesProvider>
</MantineProvider>

);

plucky chasm
torpid zealot
#

Thank you ๐Ÿ˜„