How to use the @nodegui/react-nodegui.useEventHandler function in @nodegui/react-nodegui

To help you get started, we’ve selected a few @nodegui/react-nodegui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nodegui / react-nodegui / examples / weather-app-widget / src / index.tsx View on Github external
} catch (err) {
      console.log(err);
    }
  }, []);

  const summary = weather.weather[0] || {};
  const refreshHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: async () => {
        setWeather(defaultState);
        await getWeather();
      }
    },
    []
  );
  const quitHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: () => {
        QApplication.instance().quit();
      }
    },
    []
  );

  return (
github nodegui / react-nodegui / examples / weather-app-widget / src / index.tsx View on Github external
initWindow(win);
    }
    getWeather();
  }, []);

  const getWeather = useCallback(async () => {
    try {
      const data = await getCurrentWeather();
      setWeather(data);
    } catch (err) {
      console.log(err);
    }
  }, []);

  const summary = weather.weather[0] || {};
  const refreshHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: async () => {
        setWeather(defaultState);
        await getWeather();
      }
    },
    []
  );
  const quitHandler = useEventHandler(
    {
      [QPushButtonEvents.clicked]: () => {
        QApplication.instance().quit();
      }
    },
    []
  );
github nodegui / react-nodegui-starter / src / components / steptwo.tsx View on Github external
export function StepTwo() {
  const btnHandler = useEventHandler(
    {
      clicked: () => open("https://react.nodegui.org").catch(console.log)
    },
    []
  );
  return (
github nodegui / examples / react-nodegui / react-router-example / src / pages / Home.tsx View on Github external
export default function Home() {
  const history = useHistory();
  const handler = useEventHandler(
    { [QPushButtonEvents.clicked]: () => history.push("/about") },
    []
  );
  return (
    
  );
github nodegui / examples / react-nodegui / react-router-example / src / pages / About.tsx View on Github external
export default function About() {
  const history = useHistory();
  const handler = useEventHandler(
    { [QPushButtonEvents.clicked]: () => history.goBack() },
    []
  );
  return (
    
  );

@nodegui/react-nodegui

React Native for building cross platform desktop applications

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages