mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
ReactObjectTableViewer can handle components
This commit is contained in:
@@ -20,6 +20,7 @@ const ReactObjectTableViewer = (props) => {
|
|||||||
{keys.map((k, key) => {
|
{keys.map((k, key) => {
|
||||||
const val = data[k];
|
const val = data[k];
|
||||||
const isObject = typeof val === "object";
|
const isObject = typeof val === "object";
|
||||||
|
const isElement = React.isValidElement(val);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={key}>
|
<tr key={key}>
|
||||||
@@ -32,7 +33,8 @@ const ReactObjectTableViewer = (props) => {
|
|||||||
</th>
|
</th>
|
||||||
{isObject && (
|
{isObject && (
|
||||||
<td>
|
<td>
|
||||||
<ReactObjectTableViewer {...opt} data={val} />
|
{isElement && val}
|
||||||
|
{!isElement && <ReactObjectTableViewer {...opt} data={val} />}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{!isObject && (
|
{!isObject && (
|
||||||
@@ -53,9 +55,9 @@ const ReactObjectTableViewer = (props) => {
|
|||||||
|
|
||||||
ReactObjectTableViewer.propTypes = {
|
ReactObjectTableViewer.propTypes = {
|
||||||
data: PropTypes.object,
|
data: PropTypes.object,
|
||||||
style: PropTypes.CSSProperties,
|
style: PropTypes.objectOf(PropTypes.string),
|
||||||
keyStyle: PropTypes.CSSProperties,
|
keyStyle: PropTypes.objectOf(PropTypes.string),
|
||||||
valueStyle: PropTypes.CSSProperties,
|
valueStyle: PropTypes.objectOf(PropTypes.string),
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
layout: PropTypes.string,
|
layout: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user