svg-to-geojson
svg-to-geojson copied to clipboard
frint-react: Empty Component when Region is empty
Current situation
Right now, when a Region has no Apps to render, it just remains empty.
It would be useful if we can pass some default Component to render in those cases.
Proposed API
import EmptyRegionContent from '../components/EmptyRegionContent';
<Region name="sidebar" empty={EmptyRegionContent} />
If the sidebar region is empty, it would render EmptyRegionContent component by default.
Nice idea!
As for naming, using something like default sounds more intuitive in my opinion. Mainly because the keyword is common in different languages (SQL, js, C#, etc...) for expressing a similar concept.
Should it also enable specifying a collection of default components?
default is tricky, just like class, module and exports as variable names in JavaScript.
Yep, awesome idea. I like empty because it is the same as we do for lists.