Converting SPFx Web Part from JavaScript to React