Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native: Method parser crashes #24

Closed
artyorsh opened this issue Jun 27, 2019 · 0 comments · Fixed by #25
Closed

React Native: Method parser crashes #24

artyorsh opened this issue Jun 27, 2019 · 0 comments · Fixed by #25
Labels

Comments

@artyorsh
Copy link
Collaborator

artyorsh commented Jun 27, 2019

Method parser crashes if method documentation contains no arguments

Example

 * @method {() => void} focus - Requests focus for the given input or view. The exact behavior triggered
 * will depend on the platform and type of view.

Quick fix

To get rid of this I've simply modified methods.parser.js :)

function getParamType(param) {
  const splitElement = param.split(':')[1];
  var crudeParam = splitElement && splitElement.trim();
  return crudeParam && crudeParam.split(' ')[0].trim();
}

As you can see, I simply do nothing if split function returns undefined
But it also results in incorrect output

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant