cerebroapp / cerebro-ui Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Repository of common UI react components for Cerebro plugins
License: MIT License
๐ฆ Repository of common UI react components for Cerebro plugins
License: MIT License
I was following the example of using the "Preload" element to wrap a promise response, but I get an error on Loading element:
Preload.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
If I dont specify a Loader everything works fine. I also tried to create my own Loader component but I got the same problem. Not really sure whats going on.
Here is my code for reference:
const { Preload, Loading } = require('cerebro-ui');
const NoteContents = require('./Preview/NoteContents');
const NotePreview = (key, promise) => (
<Preload key={key} promise={promise} loader={Loading}>
{(promiseResult) => <NoteContents key={key} contents={promiseResult} /> }
</Preload >
);
And its being called like this:
getPreview: () => {
const promise = evernoteService.getNoteContent(note.guid);
return NotePreview(note.guid, promise);
}
Currently loader={<Loading />}
works, but it looks a bit ugly, would be much better to allow developers to pass any component, i.e. as a functional component loader={() => <Loading />}
(currently it fails with PropTypes check)
I'd also like to help here. I've got the same issue as in #607, the app won't show at all. Just to see what happens, I've tried locally checking out cerebro-ui and manually removing the places where `nodobjc` is used. The app starts, though there are still plenty of errors.
If help is wanted, I'd love to contribute.
Originally posted by @ChFlick in cerebroapp/cerebro#602 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.