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

Break out render() code #316

Closed
morrinene opened this issue Oct 17, 2017 · 0 comments
Closed

Break out render() code #316

morrinene opened this issue Oct 17, 2017 · 0 comments
Milestone

Comments

@morrinene
Copy link

Break out render() code into more manageable chunks, specifically in the following ways:

  • For widgets that generate more DOM, move sensible chunks into separate functions, e.g. renderControls() for the buttons in ComboBox, or renderOptions in Listbox.
  • For widgets that render children, e.g. TabController, return this.children in a separate function. Just as an example, this would make it much easier to add custom loading content.
  • Split "state" classes into a separate function (getModifierClasses?) for all widgets that could potentially support multiple visual states, e.g. loading or dirty on a tab button.
  • If a widget uses an icon, generate the icon separately. Swapping out icons or using something other than a font icon for a visual symbol seems like a fairly common modification, e.g. changing left/right month arrows in Calendar for text, or tiny month preview images.
  • Widgets that calculate inline styles (right now only Slider, I think) should do so in a separate fn. This would allow a triangular volume slider to adjust the height of the thumb as it changes, for example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants