onloadCallback error if no onloadCallback function provided

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Inspect _renderGrecaptcha() and compare it with componentDidUpdate, where callback presence is checked. Reproduce the control without onloadCallback and verify that rendering no longer throws while callback behavior remains unchanged.

Written by the indexing model from the issue text.

Description

Getting the following in the console when no onloadCallback function is provided to the control:

Uncaught TypeError: this.props.onloadCallback is not a function

I don't seem to need one for my use case, and therefore this looks like a bug. There are a few spots in the code where there seems to be tests whether this is defined before it is used (e.g. componentDidUpdate), but not in _renderGrecaptcha().

Dominant language
JavaScript
Stars
643
Forks
96
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from appleboy/react-recaptcha

All issues in appleboy/react-recaptcha

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.