Skip to content

Commit

Permalink
fix: fix find is not a function issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AliKdhim87 committed Nov 10, 2022
1 parent 938301c commit f2186c6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Editor({ onChange, name, value, disabled }) {
},
products: {
productRenderer: async (id, domElement) => {
const product = productPrice?.price.find((price) => parseInt(price.id) === parseInt(id));
const product = productPrice?.price?.find((price) => parseInt(price.id) === parseInt(id));
ReactDOM.render(product?.currency ? <p id={id}>{formatCurrency(product)}</p> : null, domElement);

},
Expand Down Expand Up @@ -192,6 +192,9 @@ function Editor({ onChange, name, value, disabled }) {
React.useEffect(() => {
mounted = true
fetchProductPrice();
return () => {
mounted = false
}
}, []);

return (
Expand Down

1 comment on commit f2186c6

@vercel
Copy link

@vercel vercel bot commented on f2186c6 Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.