小编She*_*een的帖子

React-Testing 库未在快照中渲染 Material-UI 对话框

export default function CommentDialog(props) {
  const {
    approvalValue,
    handleSubmit,
    handleDialog,
    handleChange,
    handleApprovalChange,
    value,
    characterCount,
    maxCharacterValue,
  } = props;

  const { handleOpen, handleClose, open } = handleDialog;
  const classes = useStyles();

  return (
    <>
      <AddCommentButton onClick={handleOpen} />
      <Dialog fullWidth onClose={handleClose} aria-labelledby="customized-dialog-title" open={open}>
        <DialogTitle id="customized-dialog-title" onClose={handleClose}>
          Please select an outcome for this Targeting Request
        </DialogTitle>
        <RadioGroup
          aria-label="quiz"
          name="quiz"
          value={approvalValue}
          onChange={handleApprovalChange}
          className={classes.radioButtons}
        >
          <FormControlLabel value="Approved" control={<Radio color="primary" />} label="APPROVE" />
          <FormControlLabel value="Denied" control={<Radio color="secondary" />} label="DENY" />
        </RadioGroup>
        <DialogContent>
          <MarkdownEditor
            id="comment-markdown"
            error={characterCount >= …
Run Code Online (Sandbox Code Playgroud)

reactjs jestjs material-ui react-testing-library

6
推荐指数
2
解决办法
6751
查看次数

服务器端渲染(Next.js)和静态站点渲染(Gatsby.js)有什么区别?

我希望创建一个不依赖客户端 JavaScript 的网站,但是,我仍然想使用客户端路由等 SPA 功能,因此我正在考虑使用不在客户端上呈现的框架 -边。这两个似乎是此类事情的首选,但是,我不确定这两种不同类型的服务器处理之间的差异。

node.js reactjs server-side-rendering gatsby next.js

5
推荐指数
1
解决办法
325
查看次数

zip 警告:压缩目录时缺少结束签名

我正在运行zip -r nm.zip node_modules并收到此错误:

zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F)
Run Code Online (Sandbox Code Playgroud)

node_modules 是一个目录。我正在大厅内的 docker 容器内执行此操作。

zip node.js node-modules docker concourse

4
推荐指数
1
解决办法
8829
查看次数

Console.log 直接记录异步函数的输出?

我正在运行这个异步函数:

async function getIngress(namespace) {
  try {
    const result = await k8sIngressApi.listNamespacedIngress(namespace, true);
    return result.body.items[0].spec.rules[0].http.paths[0].path;
  } catch (e) {
    console.error(e.response.body);
  }
}
console.log(getIngress(argument);
Run Code Online (Sandbox Code Playgroud)

控制台日志只打印一个承诺。有没有一种方法可以像我尝试的那样在函数之外访问承诺的返回值?

javascript asynchronous node.js

2
推荐指数
1
解决办法
4881
查看次数