0

I one of my "office-ui-fabric-react" project, I am writing a utility class(common.ts) where I have a function to load theme for a page. This utility class will be included as part of the script tag in an html file as common.js.

I want to call loadTheme which is defined in \node_modules@uifabric\styling\lib\styles\node_modules@uifabric\styling\lib\styles\theme.d.ts

I tried import { loadTheme } from "office-ui-fabric-react" and gave me a generic build error.

How do I import APIs defined in "office-ui-fabric-react" from a .ts file?

Ekalavya
  • 39
  • 2
  • 1
    "... _gave me a generic build error_" - what was the error? Can you post it? –  Dec 14 '20 at 02:17
  • It basically said "cannot find common". The class in which I am using loadTheme. The error was not related to loadTheme and hence did not post initially. when I comment the import, there is no error but then I can't use loadTheme. – Ekalavya Dec 14 '20 at 02:40

0 Answers0