|
@@ -114,7 +114,7 @@ function formatForReact(formatString: string, args: FormatArg[]): React.ReactNod
|
|
|
// array with two items in.
|
|
|
match[2] = null;
|
|
|
match[1] = 1;
|
|
|
- nodes.push(<span key={idx++}>{sprintf.format([match], [null, arg])}</span>);
|
|
|
+ nodes.push(<Fragment key={idx++}>{sprintf.format([match], [null, arg])}</Fragment>);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -241,7 +241,7 @@ export function renderTemplate(
|
|
|
|
|
|
for (const item of group) {
|
|
|
if (isString(item)) {
|
|
|
- children.push(<span key={idx++}>{item}</span>);
|
|
|
+ children.push(<Fragment key={idx++}>{item}</Fragment>);
|
|
|
} else {
|
|
|
children.push(renderGroup(item.group));
|
|
|
}
|
|
@@ -249,10 +249,10 @@ export function renderTemplate(
|
|
|
|
|
|
// In case we cannot find our component, we call back to an empty
|
|
|
// span so that stuff shows up at least.
|
|
|
- let reference = components[groupKey] ?? <span key={idx++} />;
|
|
|
+ let reference = components[groupKey] ?? <Fragment key={idx++} />;
|
|
|
|
|
|
if (!isValidElement(reference)) {
|
|
|
- reference = <span key={idx++}>{reference}</span>;
|
|
|
+ reference = <Fragment key={idx++}>{reference}</Fragment>;
|
|
|
}
|
|
|
|
|
|
const element = reference as React.ReactElement;
|
|
@@ -281,7 +281,7 @@ function mark(node: React.ReactNode): string {
|
|
|
// require some understanding of reacts internal types.
|
|
|
const proxy = {
|
|
|
$$typeof: Symbol.for('react.element'),
|
|
|
- type: 'span',
|
|
|
+ type: Symbol.for('react.fragment'),
|
|
|
key: null,
|
|
|
ref: null,
|
|
|
props: {
|