Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-nodegui use? #21

Open
etoscn opened this issue Jan 7, 2020 · 3 comments
Open

react-nodegui use? #21

etoscn opened this issue Jan 7, 2020 · 3 comments

Comments

@etoscn
Copy link

etoscn commented Jan 7, 2020

for react-nodegui? help

@DimitarNestorov
Copy link
Contributor

I forked the react-nodegui example and I added the plugin here: https://github.com/dimitarnestorov/react-nodegui-starter
Here are all the changes:
https://github.com/dimitarnestorov/react-nodegui-starter/commit/12f8c71f9a3215628464ba91a324f4e2ec479f77
image

@wkirby
Copy link

wkirby commented Feb 21, 2021

@DimitarNestorov you seem to have deleted the repository with the example; any chance you can throw it in a gist or add it as a comment here?

@wkirby
Copy link

wkirby commented Feb 21, 2021

A little futzing, and I found a working solution:

import { hot, Window, Text } from "@nodegui/react-nodegui";
import React from "react";
import { setTitleBarStyle } from "@nodegui/plugin-title-bar";

class App extends React.Component {
  constructor(props) {
    super(props);
    this.window = React.createRef();
  }

  componentDidMount() {
    try {
      setTitleBarStyle(this.window.current.native, 'hiddenInset');
    } catch(err) {
      console.error(err);
    }
  }

  render() {
    return (
      <Window windowTitle="Hello 👋🏽" ref={this.window}>
         <Text>Hello</Text>
      </Window>
    );
  }
}

export default hot(App);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants