algolia / algolia/react-element-to-jsx-string

Arrow functions are converted to traditional functions

Open
#215 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
518
Forks
87
Avg merge
3h 56m
Merged PRs (30d)
3

Description

Hi, I have the following component:

```js
console.log(e)}>Click me
```
But it is transformed to this instead:

```js

Click me

```

This cast is not only visually bad, it also changes the function behavior since an arrow function passes the *this* value from the context and not function. We might want to use "this" inside the callback function to alter the parent component state.

By the way, this library is very useful ! Thanks :+1:

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.