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

inline functions are being treated as components #3011

Closed
alex-golubtsov opened this issue Jun 23, 2021 · 1 comment
Closed

inline functions are being treated as components #3011

alex-golubtsov opened this issue Jun 23, 2021 · 1 comment

Comments

@alex-golubtsov
Copy link

Very similar to #1919. The only difference is that function is passed as a property of options object.

Here is the code:

<MyComponent
  options={{
    tabBarIcon: ({ color, size }) => (
      <Icon name="dumbbell" size={size} color={color} />
    )
  }}
/>

ESLint wants color and size to be explicitly defined
image

but they actually are in tabBarIcon prop
image

@ljharb
Copy link
Member

ljharb commented Jun 23, 2021

I agree; this isn't a component because it doesn't start with a capital letter.

ljharb added a commit to ljharb/eslint-plugin-react that referenced this issue Feb 22, 2022
ljharb added a commit to ljharb/eslint-plugin-react that referenced this issue Feb 22, 2022
@ljharb ljharb closed this as completed in 24402fb Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants