commit 40c603084ad311fcc611f3b190dccd6ed87be8b0
parent ef71c5f7621f9760010d742196b7f5bd1965ede4
Author: Andreas <contact@typable.dev>
Date: Wed, 12 Apr 2023 20:02:47 +0200
Updated README.md
Diffstat:
M | README.md | | | 45 | +++++++++++---------------------------------- |
1 file changed, 11 insertions(+), 34 deletions(-)
diff --git a/README.md b/README.md
@@ -1,46 +1,23 @@
# figure
-The vanilla alternative for writing JSX-based React applications
-### Example
+### The vanilla alternative for writing JSX-based React applications
+<br/>
+
+The figure framework offers a unique approach to writing React applications by leveraging vanilla JavaScript syntax instead of JSX, making it an excellent tool for programmers who prefer to avoid the bloat of the NodeJS/npm ecosystem. With its use of template literals, figure provides a more natural way of writing code, making it ideal for building smaller applications.
+
+If you're looking for a more efficient way to build React applications, figure might just be the tool you need.
+<br/>
+<br/>
```javascript
-import figure from '...';
+import figure from 'https://typable.dev/cdn/figure/lib.js';
-// initialize figure
const { dict } = figure(React.createElement);
-
-// add your component to the dictionary
-const html = dict({
- el: {
- button: Button,
- },
-});
+const html = dict();
function App() {
return html`
- <main>
- <el:button
- type="primary"
- on:click=${() => console.log('It works!')}
- >
- <span>Click me</span>
- </el:button>
- </main>
- `;
-}
-
-function Button() {
- return html`
- <button
- on:click=${props?.onClick}
- class="btn btn--${props?.type}"
- >
- ${props?.children}
- </button>
+ <h1>I figured it out!</h1>
`;
}
-
-// render your App component as usual
-const root = document.querySelector('#root');
-ReactDOM.render(React.createElement(App), root);
```