Comments (16)
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.
@mik01aj maybe you are right that this should just live in the examples.
from react-styleguidist.
@mik01aj Would be nice to see your styleguide. Ours is quite simple so far.
from react-styleguidist.
Okay, so the TODO here is: add more advanced examples to our sample style guide.
from react-styleguidist.
@mik01aj 👍
from react-styleguidist.
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.
That's cool! 👍
I understand that the default state is {}
, right?
from react-styleguidist.
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.
{}
is fine, I believe. Just don't forget to document it :)
from react-styleguidist.
@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.
👍
from react-styleguidist.
This is great, when do you plan to do a new release?
from react-styleguidist.
In the next few days.
from react-styleguidist.
Awesome, looking forward to it.
from react-styleguidist.
@sunesimonsen It’s here! ;-)
from react-styleguidist.
Awesome thanks for letting me know.
from react-styleguidist.
Related Issues (20)
- Issue with editing the markdown
- Module parse failed: Unexpected token (1:0)
- Will PR #1700 be merged into the main branch? HOT 1
- Broken React 17 support in v13.1.0 HOT 4
- ComplexTypeRenderder - ComplexTypeRenderer filename typo
- How to maintain versions ? HOT 1
- Breakage on build with webpack v5
- JSDoc URL is incorrect within documentation HOT 1
- Support ESM for the styleguide.config.js file
- upgrading styleguidist (node:55652) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getCompilationHooks' of undefined HOT 4
- Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
- Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
- Error: Invalid hook call.
- Webpack 5 does not return compiler object with callback
- The preview doesn't rerenders after error
- Improve footer and add social icons HOT 3
- Installed webpack, babel, styleguidist and ends up throwing error when built HOT 2
- Unknown type undefined HOT 1
- Share styleguidist components between applications
- High vuln in webpack-dev-server/webpack-dev-middleware
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-styleguidist.