N
N
Nikita Shchypylov2018-03-15 00:16:16
React
Nikita Shchypylov, 2018-03-15 00:16:16

A couple of questions about Flow + React?

Hello everyone
The tickets object is passed to the component.
Such situation :5aa990d26e3fc316225241.jpeg

//@flow

import React, { Component } from "react";
import "./index.scss"; // почему он ругается? Стили подтягиваются в порядке из этого файла

type Props = {
  tickets: number, // как проверить на наличие объекта?
};

class Dashboard extends React.Component<Props> {
  render() {
    const { tickets } = this.props;
    console.log(tickets);
    return <div />;
  }
}

export default Dashboard;

Questions:
1) Why swears at styles? Webpack finds this file, but Flow says it can't find it
2) Set it to tickets number, but an object comes. Why doesn't he swear?
3) How to check tickets for an object?
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question