Skip to content

Commit 3d81bd7

Browse files
authored
Fix/event handler hook (#101)
* Typed useEventHandler * bump version
1 parent ffa06e5 commit 3d81bd7

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nodegui/react-nodegui",
3-
"version": "0.3.2",
3+
"version": "0.4.0",
44
"description": "React Native for building cross platform desktop applications",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",
@@ -27,17 +27,17 @@
2727
"react-reconciler": "^0.24.0"
2828
},
2929
"peerDependencies": {
30-
"@nodegui/nodegui": ">=0.9.0",
30+
"@nodegui/nodegui": ">=0.12.0",
3131
"@nodegui/qode": "*",
3232
"react": "^16.9.0"
3333
},
3434
"devDependencies": {
35-
"@nodegui/nodegui": "^0.11.0",
36-
"@types/node": "^12.0.10",
35+
"@nodegui/nodegui": "^0.12.0",
36+
"@types/node": "^12.12.22",
3737
"prettier": "^1.18.2",
3838
"react": "^16.9.0",
3939
"typedoc": "^0.15.4",
4040
"typedoc-plugin-markdown": "^2.2.14",
41-
"typescript": "^3.7.3"
41+
"typescript": "^3.7.4"
4242
}
4343
}

src/components/AbstractComponents/RNAbstractButton.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QIcon, QSize } from "@nodegui/nodegui";
1+
import { QIcon, QSize, QAbstractButtonSignals } from "@nodegui/nodegui";
22
import { ViewProps, setViewProps } from "../View/RNView";
33
import { QAbstractButton } from "@nodegui/nodegui";
44

@@ -23,7 +23,8 @@ import { QAbstractButton } from "@nodegui/nodegui";
2323
*
2424
* ```
2525
*/
26-
export interface AbstractButtonProps<Signals> extends ViewProps<Signals> {
26+
export interface AbstractButtonProps<Signals extends QAbstractButtonSignals>
27+
extends ViewProps<Signals> {
2728
/**
2829
* Sets the given text to the button. [QPushButton: setText](https://docs.nodegui.org/docs/api/QPushButton#buttonsettexttext)
2930
*/
@@ -38,7 +39,7 @@ export interface AbstractButtonProps<Signals> extends ViewProps<Signals> {
3839
iconSize?: QSize;
3940
}
4041

41-
export function setAbstractButtonProps<Signals>(
42+
export function setAbstractButtonProps<Signals extends QAbstractButtonSignals>(
4243
widget: QAbstractButton<Signals>,
4344
newProps: AbstractButtonProps<Signals>,
4445
oldProps: AbstractButtonProps<Signals>

src/components/View/RNView.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ export interface ViewProps<Signals extends {}> extends RNProps {
112112
ref?: any;
113113
/**
114114
* Prop to set the Widget Attributes. example:
115-
* <View attributes={{Qt::WA_Disabled: true}} />
115+
* `<View attributes={{[WidgetAttributes.WA_Disabled]: true}} />`
116116
*/
117117
attributes?: WidgetAttributesMap;
118118

119119
/**
120120
* Prop to set the Widget flags. example:
121-
* <View windowFlags={{Qt::SplashScreen: true}} />
121+
* `<View windowFlags={{[WindowType.SplashScreen]: true}} />`
122122
*/
123123
windowFlags?: WindowFlagsMap;
124124
}

0 commit comments

Comments
 (0)