小编Ism*_*dni的帖子

类型错误:无法定义属性“当前”:对象不可扩展

我有一个反应组件InputField

export default function InputField({ name, type, placeholder, className }, ref) {
  return (
    <input
      name={name}
      type={type}
      placeholder={placeholder}
      className={InputTailwindStyle}
      ref={ref}
    />
  );
}
Run Code Online (Sandbox Code Playgroud)

我尝试将其放入另一个组件LoginForm中,其中我使用react-hook-form来处理我的表单挂钩:

import { useForm } from 'react-hook-form';

(some code ... )

const { register, handleSubmit } = useForm();

<InputField
        name='password'
        type='password'
        placeholder='Password'
        ref={register}
/>
Run Code Online (Sandbox Code Playgroud)

但我收到此错误: TypeError: 无法定义属性“current”: 对象不可扩展

javascript reactjs react-hooks react-hook-form

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

API 已解析,但未发送 /api/users/create 的响应,这可能会导致请求停滞。下一个JS

我创建了一个 API 端点来处理 Next.js 应用程序中的用户帐户创建,并且使用knex.js来处理我的查询,但我仍然收到此错误:

API resolved without sending a response for /api/users/create, this may result in stalled requests.
Run Code Online (Sandbox Code Playgroud)

我的代码在/pages/api/users/create.js

API resolved without sending a response for /api/users/create, this may result in stalled requests.
Run Code Online (Sandbox Code Playgroud)

javascript api node.js knex.js next.js

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

char * ft_name(args)是否等效于c中的char * ft_name(args)?

我是C语言的初学者,所以如果和函数原型char* ft_name(args)等效的话我有点困惑char *ft_name(args)

有人可以帮我吗

c function

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