Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Renderers for Vanilla JS/Vue/Vite don't work #138

Open
daweto opened this issue Aug 29, 2024 · 0 comments
Open

Custom Renderers for Vanilla JS/Vue/Vite don't work #138

daweto opened this issue Aug 29, 2024 · 0 comments

Comments

@daweto
Copy link

daweto commented Aug 29, 2024

Hi!
The docs show that Custom Renderers can also work for for Vanilla JS, but if I define a simple function to test it, it does not work (nothing happens).

  • Im using NLUX with a Custom Adapter on a Vue 3 App with Vite.
  • Is it a bug, badly documented, or am i doing something wrong??

This is how i defined the my custom renderer to debug.

type ResponseRendererProps<T> = {
    uid: string;
    dataTransferMode: 'stream' | 'batch';
    status: 'streaming' | 'complete';
    content: [T];
    serverResponse: unknown[];
};
type ResponseRenderer<T> = (props: ResponseRendererProps<T>) => HTMLElement | null;

const customResponseRenderer: ResponseRenderer<MarkdownString> = (params) => {
  console.log('customResponseRenderer', params);
  const elmnt = document.createElement('div');
  elmnt.innerHTML = 'hello';
  return elmnt;
};
@daweto daweto changed the title Custom Renderers for Vanilla JS don't work Custom Renderers for Vanilla JS/Vue/Vite don't work Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant