(null);
+ React.useEffect(() => {
const script = document.createElement('script');
- script.src = `https://telegram.org/js/telegram-widget.js?${this.props.widgetVersion || ''}`;
+ script.src = 'https://telegram.org/js/telegram-widget.js?22';
script.async = true;
- this.instance?.appendChild(script);
- }
+ ref.current?.appendChild(script);
+ }, []);
- render() {
- return (
- {
- this.instance = component;
- }}
- >
- {this.props.children}
-
- );
- }
+ return ;
}