You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Howdy! Thanks for starting this. Before I did a bunch of work, I wanted to put forward some suggestions for components to see if you'd be interested in adding them to libreact. If there's interest, I'll definitely make some PRs!
TouchSensor: This would pass through a boolean indicating if the device supports touch interactions or not. Useful for displaying some UI components on a mobile device rather than guessing a good width.
OSOnly: The OS of the device. This would be helpful for changing/adjusting layout based on Safari's bottom bar, etc. Takes an array of OS' to target.
ReducedMotionSensor: Renders via a child function that passes through whether the user prefers reduced animation on their device. Name isn't the best. Probably just exports a specific instance of MediaSensor
Conditional components. It would be interesting to see if js-control-statements would be willing to merge with this project!
Tabs: I don't like the name, but this would provide a way to have a nav that toggles content below without (or maybe with?) changing the route.
LoadingSpinner: Some sort of nice default for a loading spinner.
TouchSensor — I would call it something like TouchSupportSensor. The question is if it has to be a render-prop, if the boolean value of it does not change over time or depending on where it is rendered in the React tree, it could simply be a plain JavaScript function.
OSOnly — similar as previous, if the value of this component does not change over time or depending where it is rendered it could be just a plain function.
ReducedMotionSensor — this sound something that could be done by user of this lib instead.
Control statements — I was thinking about including them, I don't think those are terribly useful but for the sake of completeness we could include those in this lib.
Tabs and Spinner could be added to the UI section.
Thinking about TouchSupportSensor and OSOnly, I think they could be both a function and a component. I prefer HOCs when writing my React code, personally, so I could include both.
As for control statements, similar to above, I personally find them useful as HOCs for composition, but they don't need to be in this library.
Activity
streamich commentedon Oct 12, 2018
Hey, thanks for your interest!
TouchSensor— I would call it something likeTouchSupportSensor. The question is if it has to be a render-prop, if the boolean value of it does not change over time or depending on where it is rendered in the React tree, it could simply be a plain JavaScript function.OSOnly— similar as previous, if the value of this component does not change over time or depending where it is rendered it could be just a plain function.ReducedMotionSensor— this sound something that could be done by user of this lib instead.TabsandSpinnercould be added to the UI section.mike-engel commentedon Oct 13, 2018
Thinking about
TouchSupportSensorandOSOnly, I think they could be both a function and a component. I prefer HOCs when writing my React code, personally, so I could include both.As for control statements, similar to above, I personally find them useful as HOCs for composition, but they don't need to be in this library.
Thanks! I'll start on a PR :)