From 4acadc47b560b3a75a72b2cf41a842ea8f8fb0b6 Mon Sep 17 00:00:00 2001 From: jayberg Date: Wed, 27 Sep 2017 14:09:04 +0200 Subject: [PATCH] Avoid circular reference with infinite children (#7742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because {element} is a child of , we get a circular reference when also adding "element.props" to , as will be cloned to <{element}> within InputElement.tsx. As a consequence, we get an infinitive circular loop of Element->Props->Children->Element->Props->Children->Element->Props->Children->… React seems to detect and automatically fix this infinitive loop. But when using the smaller and faster Inferno as a replacement library of React, we get a "RangeError: Maximum call stack size exceeded". This commit fixes this bug by not attaching {...element.props} to . All tests did pass and I did not notice any changes in the behaviour of the AutoComplete component. But now, AutoComplete works also with Inferno and not only with React. --- components/auto-complete/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 6b4889523f..9fd2b424ac 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -52,7 +52,7 @@ export default class AutoComplete extends React.Component; return ( - {element} + {element} ); }