Page 1 of 1

[REACT] React component as widget

Posted: Thu Jul 29, 2021 2:08 pm
by SemFA

Hello,

is there some way to use a React component as a widget in, for example, the sidebar?


Re: [REACT] React component as widget

Posted: Thu Jul 29, 2021 3:19 pm
by saki

Give us a bit more information as to where exactly you want the React component.


Re: [REACT] React component as widget

Posted: Thu Jul 29, 2021 3:24 pm
by SemFA

I would like to be able to work with react components in general. But currently, I'm looking to add a react component to the sidebar, above the resource list.


Re: [REACT] React component as widget

Posted: Thu Jul 29, 2021 4:07 pm
by saki

We do not yet have support for React components in generic widgets yet – there a feature request on that https://github.com/bryntum/support/issues/774

As a workaround, you could add a Bryntum Widget to sidebar items: https://bryntum.com/docs/calendar/#Calendar/widget/Sidebar#config-items, then grab its element at the runtime and render the React component into it, perhaps with the help of React portals.

Unfortunately, we do not have a demo of that.


Re: [REACT] React component as widget

Posted: Thu Jul 29, 2021 4:32 pm
by SemFA

Thanks, I'll follow the feature request. Hopefully it gets picked up somewhere in the close future.

I will look to build a workaround for now then.