小编Sum*_*ndu的帖子

在对象赋值解构Javascript中使用Colon

使用React.js和React Router

import React, { Component } from 'react';

const PrivateRoute = ({ component: Component, ...rest }) => (
  <Route {...rest} render={} />
)
Run Code Online (Sandbox Code Playgroud)

*{ component: Component, ...rest }*

..rest是使用扩展语法但是做了*component: Component*什么

object destructuring variable-assignment

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

quilljs 允许用户选择颜色,如输入

所以我知道你可以在颜色字段中添加颜色选项,例如

[{'color': "#000000"}]
Run Code Online (Sandbox Code Playgroud)

但我想知道是否有办法让用户可以选择颜色

<input type="color">
Run Code Online (Sandbox Code Playgroud)

javascript quill

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

节点服务器上的间歇性 EAI_AGAIN 错误

我的 nodejs 应用程序连接到外部 url 并使用响应。该应用程序大部分时间都运行良好,但我偶尔会收到 EAI_AGAIN。

error:{code:EAI_AGAIN, errno:EAI_AGAIN,syscall:getaddrinfo,hostname:**.com,host:***.com,port:443}
Run Code Online (Sandbox Code Playgroud)

我经历了一些与 EAI_AGAIN 相关的问题。没有解决我的目的。看到当 DNS 名称解析失败时会发生此错误。

我的担忧是

1)当我检查日志时。在失败的请求之前有很多成功的请求,在失败的请求之后也有很多成功的请求。为什么只有一个请求失败?

2) 真正的原因可能是什么?我想知道所有的可能性。

3) 原因可能是我们正在连接的外部服务的问题吗?

4)如果有人可以帮助重新创建问题,那就太好了。

注意:我们使用的是 docker 容器。如果这有什么关系。

dns rest network-programming request node.js

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

how to show error message in react js when http request send?

could you please tell me how to show error message in react js when http request send ?

I make a service in the nodejs where I am sending 400 status with error message . I want to show this error message on frontend.

app.get('/a',(req,res)=>{
    res.status(400).send({message:" some reason error message"})
})
Run Code Online (Sandbox Code Playgroud)

Now I want to show this error message on frontend .on catch I will not get this message.

try {
            const r = await axios.get('http://localhost:3002/a');
} …
Run Code Online (Sandbox Code Playgroud)

javascript node.js reactjs axios

3
推荐指数
1
解决办法
8374
查看次数