Git Product home page Git Product logo

vscode-convert-object-to-jsx's People

Contributors

zachgawlik avatar zachhardesty7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vscode-convert-object-to-jsx's Issues

Fails with code indented with tabs

The extension unfortunately has issues with regex parsing tabs for checking consistent indentation. Pretty much everything I tried failed, but if you'd like a simple case, this will cause an error.

	status: STATUS.SUCCESS

Feature request: bidirectional conversion

I was looking for an extension that converts jsx props to object (e.g. when hoisting props into useMemo or a callback or factory function).

Doesn't seem to be one out there, perhaps you'd want to upgrade this one to do both?

Converts only first of multiple selections

Thanks for the great tool!

I noticed that when making multiple selections of jsx props in different components, the tool only converts the first selection. It would save so much time and effort if it could convert all selections at once.

Not working with multiline string

Hey @ZachGawlik I'm excited to use your extension, but for some reason it isn't working. Here is a video of what's happening when I'm trying to convert the following jsx props:

    toggleOrButton = (
      <EnhancedSwitch
        data-test={type}
        didMount={() => {
          hook && hook(!!(that.state || {})[type]);
        }}
        checked={(that.state || {})[type]}
        label={label ? <span>{label}</span> : type}
        style={{ margin: "0px 30px", marginTop: 4 }}
        onChange={() => {
          hook && hook(!(that.state || {})[type]);
          that.setState({
            [type]: !(that.state || {})[type]
          });
        }}
      />
    );

jsx

It looks like the string is coming into your extension correctly:
image

But the getProps function isn't breaking it up into props correctly:

image

All the props are on a single line of the array!

Let me know if I can you need more info from me or if you're able to reproduce with the snippet I sent you. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.