GithubHelp home page GithubHelp logo

Comments (16)

mik01aj avatar mik01aj commented on May 10, 2024

Imho it's fine what you did. You could even do React.createClass in your code if you need to, no hacks needed.

I have even more complex examples in my styleguide. And if they get really big you can move the example to a separate jsx file and require it from the examples md file.

from react-styleguidist.

sunesimonsen avatar sunesimonsen commented on May 10, 2024

@mik01aj maybe you are right that this should just live in the examples.

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

@mik01aj Would be nice to see your styleguide. Ours is quite simple so far.

from react-styleguidist.

mik01aj avatar mik01aj commented on May 10, 2024

Okay, so the TODO here is: add more advanced examples to our sample style guide.

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

@mik01aj 👍 :shipit:

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

I was trying to find a simpler way to do what you want but couldn’t so I’ve added state to examples:

I’ll add an example and docs later.

from react-styleguidist.

mik01aj avatar mik01aj commented on May 10, 2024

That's cool! 👍

I understand that the default state is {}, right?

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

Yes. I’m not sure whether we need a way to define the default state and how to do that. Right now you can do something like this:

'prop' in state || setState({prop: 42});

from react-styleguidist.

mik01aj avatar mik01aj commented on May 10, 2024

{} is fine, I believe. Just don't forget to document it :)

from react-styleguidist.

sunesimonsen avatar sunesimonsen commented on May 10, 2024

@sapegin the state access is exactly what I want. We made our own solution, but we will switch to this when it is available. Thanks.

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

👍

from react-styleguidist.

sunesimonsen avatar sunesimonsen commented on May 10, 2024

This is great, when do you plan to do a new release?

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

In the next few days.

from react-styleguidist.

sunesimonsen avatar sunesimonsen commented on May 10, 2024

Awesome, looking forward to it.

from react-styleguidist.

sapegin avatar sapegin commented on May 10, 2024

@sunesimonsen It’s here! ;-)

from react-styleguidist.

sunesimonsen avatar sunesimonsen commented on May 10, 2024

Awesome thanks for letting me know.

from react-styleguidist.

Related Issues (20)

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.