Compare commits

..

2 Commits

Author SHA1 Message Date
semantic-release-bot
a1fdae9cd2 chore(release): 1.6.0 [CI SKIP] 2022-08-13 01:25:46 +00:00
AAGaming
7cf45cf371 feat(Utilities): add wrapReactType utility 2022-08-12 21:24:56 -04:00
4 changed files with 15 additions and 3 deletions

View File

@@ -1,3 +1,10 @@
# [1.6.0](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.5.1...v1.6.0) (2022-08-13)
### Features
* **Utilities:** add wrapReactType utility ([7cf45cf](https://github.com/SteamDeckHomebrew/decky-frontend-lib/commit/7cf45cf3718d6e5295115f28a5f4dd24c6ff14e3))
## [1.5.1](https://github.com/SteamDeckHomebrew/decky-frontend-lib/compare/v1.5.0...v1.5.1) (2022-08-10)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "decky-frontend-lib",
"version": "1.5.1",
"version": "1.6.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "decky-frontend-lib",
"version": "1.5.1",
"version": "1.6.0",
"license": "GPL-2.0-or-later",
"dependencies": {
"minimist": "^1.2.6"

View File

@@ -1,6 +1,6 @@
{
"name": "decky-frontend-lib",
"version": "1.5.1",
"version": "1.6.0",
"description": "A library for building decky plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -82,6 +82,11 @@ export function unpatch(obj: any, name: any): void {
obj[name] = obj[name].__deckyOrig;
}
export function wrapReactType(node: any) {
const oldComponent = node.type;
return node.type = (...args: any[]) => React.createElement(oldComponent, ...args)
}
export function getReactInstance(o: HTMLElement | Element | Node) {
return o[Object.keys(o).find(k => k.startsWith('__reactInternalInstance')) as string]
}