my recognition: tinybase let us not use react hook, right? #84
-
my recognition: tinybase let us not use react hook, right? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Incorrect! You will need to import the optional eg: const store = createStore().setCell('pets', 'fido', 'color', 'brown');
const App = () => <span>{useCell('pets', 'fido', 'color', store)}</span>;
const app = document.createElement('div');
const root = ReactDOMClient.createRoot(app);
root.render(<App />);
console.log(app.innerHTML);
// -> '<span>brown</span>'
store.setCell('pets', 'fido', 'color', 'walnut');
console.log(app.innerHTML);
// -> '<span>walnut</span>' Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks, @jamesgpearce Q1. https://riffle.systems/essays/prelude/ Q2. https://news.ycombinator.com/item?id=32871392 Q3. p.s. By the way, I said "let" in my poor English because of my wish to be "as independent from any ui library as possible" |
Beta Was this translation helpful? Give feedback.
Sorry I missed this follow up! You should be able to just use TinyBase on its own without adding the ui-react module, no?