Hi i am facing the issue.
Package version i am using "react-copy-code": "^2.1.2",
how to use the componentDidUpdate with codeBlock
Code example
let dynamic_str = "this is dynamic code ".${val1} string to more like ${val2} `
return (
{/* this html tag render the correct dynamic string */}
${dyanamic_str}
{/* this CodeBlock tag render the Incorrect dynamic string when component update dynamic string not updating */}
<CodeBlock
className="App"
componentDidUpdate
text
highlight
onCopy ={() => alert("Code copied ")}
>
{" "}
{`
dataLayer.push({ ecommerce: null });
dataLayer.push({
${dynamic_str}
});
</script>`}
</code>
</pre>
</CodeBlock>
);
};
Hi i am facing the issue.
Package version i am using
"react-copy-code": "^2.1.2",how to use the
componentDidUpdatewith codeBlockCode example
let dynamic_str = "this is dynamic code ".${val1} string to more like ${val2} `return (
{/* this html tag render the correct dynamic string */}
${dyanamic_str}{/* this CodeBlock tag render the Incorrect dynamic string when component update dynamic string not updating */}
<CodeBlock
className="App"
componentDidUpdate
text
highlight
onCopy ={() => alert("Code copied ")}
>