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

Is text in the "Dynamic code snippets" documentation a typo or a feature? #42

Open
wosephjeber opened this issue Apr 30, 2024 · 1 comment
Labels
on roadmap This request is in the Code Connect roadmap

Comments

@wosephjeber
Copy link

First off, my team is super excited about this tool! From our experimentation so far it's looking really promising as a way to help bridge the gap between designers and engineers.

I'm confused by the text prop in the "Dynamic code snippets" documentation, though:

import figma from '@figma/code-connect'

figma.connect(Button, 'https://...', {
  props: {
    label: figma.string('Text Content'),
    disabled: figma.boolean('Disabled'),
    type: figma.enum('Type', {
      Primary: 'primary',
      Secondary: 'secondary',
    }),
  },
  example: ({ disabled, text, type }) => {
    return (
      <Button disabled={disabled} type={type}>
        {text}
      </Button>
    )
  },
})

That code snippet also shows up in the blog post.

Is this a typo, and the text prop in the example should really be label from the props mapping? Or is there a special text prop that gets passed to the example for all components?

@ptomas-figma
Copy link
Collaborator

That is, indeed, a typo! Either the label prop should be text or the text argument should be label. We'll fix in the next release. Thanks!

@ptomas-figma ptomas-figma added the on roadmap This request is in the Code Connect roadmap label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on roadmap This request is in the Code Connect roadmap
Projects
None yet
Development

No branches or pull requests

2 participants