From 52bf62ec6a77d25f9a78a04d988daf07b8acd1a9 Mon Sep 17 00:00:00 2001 From: Bryce Kolton Date: Thu, 17 Oct 2019 14:47:15 -0700 Subject: [PATCH] Fixed className -> class --- package-lock.json | 2 +- package.json | 2 +- src/index.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 122369d..87885cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "reactify-wc", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6ed4b66..58f93c5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "reactify-wc", "author": "Bryce Kolton (624), Mercedes-Benz R&D North America, Seattle HUB", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "description": "Wraps web components in React to allow usage and correct property passthrough", "module": "dist/index.js", diff --git a/src/index.ts b/src/index.ts index d035c96..acde265 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,9 @@ const reactifyWebComponent = (WC: string) => { if (prop === "children") { return undefined; } + if (prop.toLowerCase() === "classname") { + return (this.ref.className = val); + } if (typeof val === "function" && prop.match(/^on[A-Z]/)) { const event = prop[2].toLowerCase() + prop.substr(3); this.eventHandlers.push([event, val]);