felixhageloh / uebersicht

ˈyːbɐˌzɪçt
GNU General Public License v3.0
4.59k stars 165 forks source link

Add `eventListener` after render in JSX? #512

Closed twio142 closed 1 year ago

twio142 commented 1 year ago

There was a afterRender function in coffeeScript that allows executing codes after the component is rendered. Is there a counterpart of such in JSX?

Or how else can I add an eventListener to certain elements?

Thanks in advance :)

twio142 commented 1 year ago

Ah, just found a solution...

import { React } from 'uebersicht';
const { useEffect, useRef } = React;