@bulmil/react
Advanced tools
Comparing version 0.26.0 to 0.26.1
@@ -57,10 +57,16 @@ "use strict"; | ||
let propsToPass = Object.keys(cProps).reduce((acc, name) => { | ||
const value = cProps[name]; | ||
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) { | ||
const eventName = name.substring(2).toLowerCase(); | ||
if (typeof document !== 'undefined' && (0, utils_1.isCoveredByReact)(eventName)) { | ||
acc[name] = cProps[name]; | ||
acc[name] = value; | ||
} | ||
} | ||
else { | ||
acc[name] = cProps[name]; | ||
// we should only render strings, booleans, and numbers as attrs in html. | ||
// objects, functions, arrays etc get synced via properties on mount. | ||
const type = typeof value; | ||
if (type === 'string' || type === 'boolean' || type === 'number') { | ||
acc[(0, utils_1.camelToDashCase)(name)] = value; | ||
} | ||
} | ||
@@ -67,0 +73,0 @@ return acc; |
@@ -13,3 +13,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
import React, { createElement } from 'react'; | ||
import { attachProps, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs, } from './utils'; | ||
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs, } from './utils'; | ||
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => { | ||
@@ -36,10 +36,16 @@ if (defineCustomElement !== undefined) { | ||
let propsToPass = Object.keys(cProps).reduce((acc, name) => { | ||
const value = cProps[name]; | ||
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) { | ||
const eventName = name.substring(2).toLowerCase(); | ||
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) { | ||
acc[name] = cProps[name]; | ||
acc[name] = value; | ||
} | ||
} | ||
else { | ||
acc[name] = cProps[name]; | ||
// we should only render strings, booleans, and numbers as attrs in html. | ||
// objects, functions, arrays etc get synced via properties on mount. | ||
const type = typeof value; | ||
if (type === 'string' || type === 'boolean' || type === 'number') { | ||
acc[camelToDashCase(name)] = value; | ||
} | ||
} | ||
@@ -46,0 +52,0 @@ return acc; |
{ | ||
"name": "@bulmil/react", | ||
"sideEffects": false, | ||
"version": "0.26.0", | ||
"version": "0.26.1", | ||
"author": "Gomah", | ||
@@ -44,3 +44,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@bulmil/core": "0.26.0" | ||
"@bulmil/core": "0.26.1" | ||
}, | ||
@@ -51,3 +51,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "c08b02518821679638dc8ba662b46910b219a94f" | ||
"gitHead": "018163f8f815b79e428ac1bec1a7c1dc7e336fa2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115207
1361
+ Added@bulmil/core@0.26.1(transitive)
- Removed@bulmil/core@0.26.0(transitive)
Updated@bulmil/core@0.26.1