Skip to content
Discussion options

You must be logged in to vote

Here is a simple block which fetches data from server and renders in builder. This will work in builder and rendering ChaiBlocks as react components.
However, if you wish to export it as HTML, it is not supported as the export html part is synchronus.
Can you elaborate little more about your use case?
Builder has support for data binding as well, so , may be that might work for you.

import { registerChaiBlock } from "@chaibuilder/runtime";
import React, { useEffect, useState } from "react";

interface Post {
  userId: number;
  id: number;
  title: string;
  body: string;
}

const DynamicComponent = () => {
  const [post, setPost] = useState<Post | null>(null);
  const [isLoading, setIsLo…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tawfek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants