× Error: Invalid hook call.
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 46
- 派生
- 8
- PR 合并指标
- 30 天内没有已合并 PR
描述
Trying to bring Convertkit form into a React application. Directly using the JavaScript embed provided by CK <script async data-uid="e9274113f5" src="https://astounding-creator-7935.ck.page/e9274113f5/index.js"></script> does not work as-is in React. Using convertkit-react, the connection is made but the template is not being brought in. I am getting: Error: Invalid hook call.
The example usage does not show the code in relation to the render() function.
This is the standalone form https://astounding-creator-7935.ck.page/e9274113f5
import Container from 'react-bootstrap/Container'
import ConvertKitForm from 'convertkit-react'
const MY_FORM_ID = 2248904
class Convertkit extends React.Component {
render() {
const config = {
formId: MY_FORM_ID,
template: 'cocoa',
// emailPlaceholder: 'Enter an email address',
// submitText: 'Sign up',
}
return (
<Container className="section">
<p>Yo</p>
<ConvertKitForm {...config} />
</Container>
)
}
}
export default Convertkit;```
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 issue 中展示的 convertkit-react 使用示例和类组件的 render() 函数开始,然后使用提供的 ConvertKit 表单配置重现 Invalid hook call。完成的标准是 React 应用连接到独立表单,并在没有 hook 错误的情况下渲染所选模板。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100