Kit / Kit/convertkit-react

× Error: Invalid hook call.

Open
#5 8 comments 3 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
46
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Trying to bring Convertkit form into a React application. Directly using the JavaScript embed provided by CK `` 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 React from 'react';
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 (

Yo



)
}
}

export default Convertkit;```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the convertkit-react example usage and the class component's render() function shown in the issue, then reproduce the Invalid hook call with the supplied ConvertKit form configuration. Done means the React application connects to the standalone form and renders the selected template without the hook error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.