fbpx

Introducing createInterpolateElement

With the release of WordPress 5.5 there will be a new function available on the wp.element package, createInterpolateElement.

This function creates an interpolated element from a passed in string with specific tags matching how the string should be converted to an element or React node given a conversion map value.

This function offers the ability to handle a couple use-cases:

When you have a template string with placeholders for where you inject known html elements or React components. When you have a translation string where you want to communicate placeholders for html elements to those translating the string.

One problem

This post was originally published on this site

GET UP TO $500K IN BUSINESS FUNDING

Pin It on Pinterest

Share This
Xiphos Web Marketing

FREE
VIEW