-1

I have a render method inside React component:

import * as React from "react";
import MediaService from "./service/MediaService";
import ComponentLifecycle = require("@types/react");
import DOMHelper from "../helpers/DOMHelper";

export default class PictureTaker extends React.Component implements ComponentLifecycle {
    // Not important

    render () {
        return (
          <article>
              <video id="ra-video">
                  Video not supported
              </video>
          </article>
        );
    }
}

It marks id as attribute id is not allowed here, but OK - I got it. I want to refactor code to extract <video> to another component:

import * as React from "react";

export default class VideoPlayer extends React.Component {
    constructor () {
        super();
    }

    render () {
        return (
            <video id="ra-video">
                Video not supported
            </video>
        );
    }
}

But it brokes with message: unresolved type video. Here is how it looks like: Broken render() method

Code for VideoPlayer is pasted from PictureTaker, and it suprised me. I have React:

React imported in project

And React DOM:

React DOM

inside Settings / Languages and frameworks / Javascript / Libraries. Do you see any mistakes made by me? Thank you in advance for every answer.

Radek Anuszewski
  • 1,812
  • 8
  • 34
  • 62

2 Answers2

-1

Geez, I found a solution... I used .ts extension instead of .tsx. It was VideoPlayer.ts, and should be VideoPlayer.tsx, my bad.

Radek Anuszewski
  • 1,812
  • 8
  • 34
  • 62
  • 1
    you can just delete the question, "typo/non-preproducible" – pvg Sep 16 '17 at 08:51
  • @pvg Maybe, but it is a chance for React rookies to made mistakes like mine, and it could prevent them for wasting a hour like I wasted. – Radek Anuszewski Sep 16 '17 at 08:55
  • There really isn't any chance of that any more than there's a chance of having _any_ typo repeated. That's why that flag exists. – pvg Sep 16 '17 at 10:23
-1

What is video? You will have to import video.js along with React.js to use

ThinkGeek
  • 4,749
  • 13
  • 44
  • 91