Comments (3)
Ah, true, @XVincentX, good point!
from attributes-kit.
So, I am not expert yet in the React, but I will, anyway, kickoff the discussion.
Since state increases complexity and reduces predictability, a Component without state is preferable. Even though you clearly can't do without state in an interactive app, you should avoid having too many Stateful Components.
But of course, we cannot create applications without states, so they must live somewhere.
I think a good way to identify a component that should have a state is when it is the only one listening to an event.
I'll make an example from the current code.
As you can see, Playground and RefractPreview are listening to the same event.
In this case, I would just let Playground component listen to the event, and then propagate that to the subcomponents that will re render themselves.
What do you think about?
This commit goes in that direction, by the way.
from attributes-kit.
Tracking as https://github.com/apiaryio/kit-template/issues/4 in the kit-template
repository.
from attributes-kit.
Related Issues (20)
- UI appearance of object-array data structure HOT 2
- Mixin content is not in place HOT 3
- Preprocessor • Feature Requests
- Attributes Kit does not render samples for an element HOT 1
- When using the `render` method, options are not passed
- The expand/collapse button not rendered for top-level fields HOT 2
- Attributes Kit doesn't render descriptions of some elements
- Apiary Blueprint Docs: Table in data structure definition HOT 5
- Strange naming/underscore issue HOT 2
- Rendering on One Of HOT 2
- Attributes Kit is not able to render the ‘category’ element HOT 5
- Revamp attributes kit
- Sample values of object showing as `[object Object]` HOT 1
- How to install for Windows7 HOT 1
- Nullable attribute isn't rendered HOT 3
- Attributes#onElementLinkClick should receive minim element HOT 2
- Attributes#dereferencedDataStructures minim support
- Rendering one of with "Include" mixin HOT 1
- Rendering array with samples doesn't render the example structures HOT 1
- Move away from inline styles HOT 1
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 attributes-kit.