Skip to content

ctx.canvas is null #40

Description

@alexgleason

Reproduction:

import { createCanvas } from 'https://deno.land/x/canvas@v1.4.1/mod.ts';

const canvas = createCanvas(300, 100);
const ctx = canvas.getContext('2d');

ctx.canvas; // null

It matters because I want to be able to pass the ctx into other functions and be able to get the canvas.

According to mdn it can be null if there's no associated canvas. But in TypeScript it's never null.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions