From 2aeea6c4657ce122e54617310b1d4fc8ce7884cb Mon Sep 17 00:00:00 2001 From: Johannes Lumpe Date: Tue, 13 Dec 2016 17:43:18 -0500 Subject: [PATCH] Allow `id` to be passed by default It seems rather common that you want to assign an id and since it's a generic prop it cannot hurt to allow it to always pass through. --- modules/bindings/react/createComponent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/bindings/react/createComponent.js b/modules/bindings/react/createComponent.js index 5d4d8605f..e5d4a36d4 100644 --- a/modules/bindings/react/createComponent.js +++ b/modules/bindings/react/createComponent.js @@ -2,7 +2,7 @@ import { createElement, PropTypes } from 'react' export default function createComponent(rule, type = 'div', passThroughProps = []) { - const FelaComponent = ({ children, className, style, passThrough = [], ...ruleProps }, { renderer, theme }) => { + const FelaComponent = ({ children, className, id, style, passThrough = [], ...ruleProps }, { renderer, theme }) => { // filter props to extract props to pass through const componentProps = [ ...passThroughProps, ...passThrough ].reduce((output, prop) => { @@ -11,6 +11,7 @@ export default function createComponent(rule, type = 'div', passThroughProps = [ }, { }) componentProps.style = style + componentProps.id = id const cls = className ? className + ' ' : '' ruleProps.theme = theme || { }