Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 866 Bytes

jsx-callback-arrow-function.md

File metadata and controls

45 lines (25 loc) · 866 Bytes

jsx-callback-arrow-function (jsx-callback-arrow-function)

This rule warns about a Mitosis limitation.

Rule Details

This rule aims to warn you if you pass anything to a callback other than arrow function.

Examples of incorrect code for this rule:

      <button onClick={ function(event) {} }/>

      <button onClick={ null }/>

      <button onClick={ "string" }/>

      <button onClick={ 1 }/>

      <button onClick={ true }/>

      <button onClick={ {} }/>

      <button onClick={ [] }/>

      <button onBlur={ [] }/>

      <button onChange={ [] }/>

Examples of correct code for this rule:

   <button/>

   <button type="button"/>

   <button onClick={ event => doSomething(event) }/>

   <button onClick={ event => doSomething() }/>

   <button onClick={ event => {} }/>

   <button onClick={ () => doSomething() }/>