mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-14 04:05:14 +00:00
21 lines
674 B
TypeScript
21 lines
674 B
TypeScript
|
/* eslint-disable react/prop-types */
|
||
|
import React, { useEffect, useRef } from "react";
|
||
|
|
||
|
export const KOCommentIfStart: React.FunctionComponent<{ if: string }> = props => {
|
||
|
const el = useRef();
|
||
|
useEffect(() => {
|
||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||
|
(el.current as any).outerHTML = `<!-- ko if: ${props.if} -->`;
|
||
|
}, []);
|
||
|
return <div ref={el} />;
|
||
|
};
|
||
|
|
||
|
export const KOCommentEnd: React.FunctionComponent = () => {
|
||
|
const el = useRef();
|
||
|
useEffect(() => {
|
||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||
|
(el.current as any).outerHTML = `<!-- /ko -->`;
|
||
|
}, []);
|
||
|
return <div ref={el} />;
|
||
|
};
|