baronha / ting

🍞 Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin
MIT License
313 stars 24 forks source link

Are there any plans to add web support ? #22

Closed a-eid closed 5 months ago

a-eid commented 6 months ago

thank you for such an amazing package, I was wondering if there were any plans to add web support ?

probably with something like sooner

import React, { useEffect } from "react";

import * as Sonner from "sonner";

let hasMountedToaster = false;

export function getHasMountedWebToaster() {
  return hasMountedToaster;
}

export const Toaster: (typeof Sonner)["Toaster"] = (props) => {
  hasMountedToaster = true;
  useEffect(() => {
    hasMountedToaster = true;
    return () => {
      hasMountedToaster = false;
    };
  }, []);
  return (
    <Sonner.Toaster
      {...props}
      style={{
        // show on top of RNW modals
        zIndex: 1000000,
        ...props.style,
      }}
    />
  );
};
baronha commented 6 months ago

Sorry. I have no idea about that yet