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

Jotai alias (shortcut) #6

Open
flaxes opened this issue Oct 23, 2024 · 0 comments
Open

Jotai alias (shortcut) #6

flaxes opened this issue Oct 23, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@flaxes
Copy link

flaxes commented Oct 23, 2024

I propose creating alias of "jotai" component for shortcuts:

Use jo instead of jotai everytime.

Before:

import { jotai } from 'jotai-components'

function Parent() {
  return (
    <jotai.div className="ordinary-props-as-well">example</jotai.div>
  )
}

After:

import { jo } from 'jotai-components'

function Parent() {
  return (
    <jo.div className="ordinary-props-as-well">example</jo.div>
  )
}

Benefits

  • Improve readability of JSX code by shortening components, especially in heavy components
  • Reduces source code in boilerplates

Also, I cannot create useful issues, cause labels are not available...

@boar-is boar-is added enhancement New feature or request good first issue Good for newcomers labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants