6

I'm using Webpack bundler and configured appropriate loaders for .fs, .scss, .css files. Now how do I import a stylesheet into a Fable based React Component?

open Fable.React
open Fable.React.Props

// open 'MyComponent.scss' ????

type MyComponent(props) =
         inherit Component<unit, unit>(props)

I know there's no straight forward way to achieve this. But there's no clear documentation about the same. Any ideas?

1 Answers1

6
Fable.Core.JsInterop.importAll "MyComponent.scss"
Filipe Carvalho
  • 608
  • 2
  • 8
  • 26
  • 3
    I was getting this error: Module not found: Error: Can't resolve 'JobBoardView.scss' in '/home/steve/Documents/KysoCal/src/Client/Jobs' Changing: Fable.Core.JsInterop.importAll "JobBoardView.scss" to: Fable.Core.JsInterop.importAll "./JobBoardView.scss" fixed the issue and now it works perfectly. – Steve Jun 27 '20 at 22:15