Got it:

override this.ComponentDidMount () =

1
2
3
4
5
        let canvas = As<CanvasElement> (JS.Document.GetElementById( "can"))

        canvas.Height <- 400
        canvas.Width  <- 600
        let context  = canvas.GetContext("2d")

Is there an easier way?

By on 9/12/2019 2:46 AM ()

If you don't have a let binding to the element directly, then the above is about as good as you get.

By on 9/12/2019 11:25 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper