refactor(element-parsing): handle elements with integer ids closes #500
This commit is contained in:
@@ -11,7 +11,7 @@ const useElementUpdater = (propElements: Elements): void => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const nextElements: Elements = propElements.map((propElement) => {
|
const nextElements: Elements = propElements.map((propElement) => {
|
||||||
const existingElement = stateElements.find((el) => el.id === propElement.id);
|
const existingElement = stateElements.find((el) => el.id === propElement.id?.toString());
|
||||||
|
|
||||||
if (existingElement) {
|
if (existingElement) {
|
||||||
const data = !isEqual(existingElement.data, propElement.data)
|
const data = !isEqual(existingElement.data, propElement.data)
|
||||||
@@ -41,7 +41,7 @@ const useElementUpdater = (propElements: Elements): void => {
|
|||||||
if (typeof propElement.isHidden !== 'undefined') {
|
if (typeof propElement.isHidden !== 'undefined') {
|
||||||
elementProps.isHidden = propElement.isHidden;
|
elementProps.isHidden = propElement.isHidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof propElement.type !== 'undefined') {
|
if (typeof propElement.type !== 'undefined') {
|
||||||
elementProps.type = propElement.type;
|
elementProps.type = propElement.type;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user