Skip to content

Commit

Permalink
Migrate to import * as React from 'react';
Browse files Browse the repository at this point in the history
Ref facebook/react#18102

Finally react team officially ditched default import.
  • Loading branch information
TrySound committed Feb 22, 2020
1 parent fe80ce3 commit 1f799b3
Show file tree
Hide file tree
Showing 52 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion examples/Api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import transform from 'lodash/transform'

import metadata from 'component-metadata-loader!react-big-calendar/lib/Calendar'
Expand Down
2 changes: 1 addition & 1 deletion examples/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import Api from './Api'
import Intro from './Intro.md'
import { render } from 'react-dom'
Expand Down
2 changes: 1 addition & 1 deletion examples/Card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

const propTypes = {}

Expand Down
2 changes: 1 addition & 1 deletion examples/demos/basic.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import events from '../events'
import * as dates from '../../src/utils/dates'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/createEventWithNoOverlap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import events from '../events'
import ExampleControlSlot from '../ExampleControlSlot'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/cultures.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar } from 'react-big-calendar'
import events from '../events'
import Layout from 'react-tackle-box/Layout'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/customHeader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar } from 'react-big-calendar'
import events from '../events'

Expand Down
2 changes: 1 addition & 1 deletion examples/demos/customView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'

import * as dates from 'date-arithmetic'
import events from '../events'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/dnd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import events from '../events'
import { Calendar, Views } from 'react-big-calendar'
import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/dndOutsideSource.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import events from '../events'
import { Calendar, Views } from 'react-big-calendar'
import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/dndresource.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar } from 'react-big-calendar'
import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop'

Expand Down
2 changes: 1 addition & 1 deletion examples/demos/popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar } from 'react-big-calendar'
import events from '../events'
import ExampleControlSlot from '../ExampleControlSlot'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/rendering.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import events from '../events'

Expand Down
2 changes: 1 addition & 1 deletion examples/demos/resource.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import ExampleControlSlot from '../ExampleControlSlot'

Expand Down
2 changes: 1 addition & 1 deletion examples/demos/selectable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import events from '../events'
import ExampleControlSlot from '../ExampleControlSlot'
Expand Down
2 changes: 1 addition & 1 deletion examples/demos/timeslots.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { Calendar, Views } from 'react-big-calendar'
import events from '../events'

Expand Down
2 changes: 1 addition & 1 deletion src/Agenda.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import addClass from 'dom-helpers/addClass'
import removeClass from 'dom-helpers/removeClass'
import getWidth from 'dom-helpers/width'
Expand Down
2 changes: 1 addition & 1 deletion src/BackgroundCells.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import { findDOMNode } from 'react-dom'
import clsx from 'clsx'

Expand Down
2 changes: 1 addition & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import { uncontrollable } from 'uncontrollable'
import clsx from 'clsx'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/CalendarContext.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import React from 'react'
import * as React from 'react'

export default React.createContext()
2 changes: 1 addition & 1 deletion src/DateContentRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import clsx from 'clsx'
import getHeight from 'dom-helpers/height'
import qsa from 'dom-helpers/querySelectorAll'
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import { findDOMNode } from 'react-dom'

import * as dates from './utils/dates'
Expand Down
2 changes: 1 addition & 1 deletion src/DateHeader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'

const DateHeader = ({ label, drilldownView, onDrillDown }) => {
if (!drilldownView) {
Expand Down
2 changes: 1 addition & 1 deletion src/Day.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'

import * as dates from './utils/dates'
import { navigate } from './utils/constants'
Expand Down
2 changes: 1 addition & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import { findDOMNode } from 'react-dom'
import clsx from 'clsx'

Expand Down
2 changes: 1 addition & 1 deletion src/EventCell.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import clsx from 'clsx'
import * as dates from './utils/dates'

Expand Down
2 changes: 1 addition & 1 deletion src/EventEndingRow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import EventRowMixin from './EventRowMixin'
import { eventLevels } from './utils/eventLevels'
import range from 'lodash/range'
Expand Down
2 changes: 1 addition & 1 deletion src/EventRow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types'
import clsx from 'clsx'
import React from 'react'
import * as React from 'react'
import EventRowMixin from './EventRowMixin'

class EventRow extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion src/EventRowMixin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import EventCell from './EventCell'
import { isSelected } from './utils/selection'

Expand Down
2 changes: 1 addition & 1 deletion src/Header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'

const Header = ({ label }) => {
return <span>{label}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/Month.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import { findDOMNode } from 'react-dom'
import clsx from 'clsx'

Expand Down
2 changes: 1 addition & 1 deletion src/Popup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import getOffset from 'dom-helpers/offset'
import getScrollTop from 'dom-helpers/scrollTop'
import getScrollLeft from 'dom-helpers/scrollLeft'
Expand Down
2 changes: 1 addition & 1 deletion src/ResourceHeader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'

const ResourceHeader = ({ label }) => {
return <React.Fragment>{label}</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion src/TimeGrid.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types'
import clsx from 'clsx'
import * as animationFrame from 'dom-helpers/animationFrame'
import React, { Component } from 'react'
import * as React, { Component } from 'react'
import { findDOMNode } from 'react-dom'
import memoize from 'memoize-one'

Expand Down
2 changes: 1 addition & 1 deletion src/TimeGridEvent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import clsx from 'clsx'
import React from 'react'
import * as React from 'react'

function stringifyPercent(v) {
return typeof v === 'string' ? v : v + '%'
Expand Down
2 changes: 1 addition & 1 deletion src/TimeGridHeader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types'
import clsx from 'clsx'
import scrollbarSize from 'dom-helpers/scrollbarSize'
import React from 'react'
import * as React from 'react'

import * as dates from './utils/dates'
import DateContentRow from './DateContentRow'
Expand Down
4 changes: 2 additions & 2 deletions src/TimeGutter.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import clsx from 'clsx'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import * as React from 'react'

import * as TimeSlotUtils from './utils/TimeSlots'
import TimeSlotGroup from './TimeSlotGroup'

export default class TimeGutter extends Component {
export default class TimeGutter extends React.Component {
constructor(...args) {
super(...args)

Expand Down
4 changes: 2 additions & 2 deletions src/TimeSlotGroup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import clsx from 'clsx'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import * as React from 'react'

import BackgroundWrapper from './BackgroundWrapper'

export default class TimeSlotGroup extends Component {
export default class TimeSlotGroup extends React.Component {
render() {
const {
renderSlot,
Expand Down
2 changes: 1 addition & 1 deletion src/Toolbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import clsx from 'clsx'
import { navigate } from './utils/constants'

Expand Down
2 changes: 1 addition & 1 deletion src/Week.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import * as dates from './utils/dates'
import { navigate } from './utils/constants'
import TimeGrid from './TimeGrid'
Expand Down
2 changes: 1 addition & 1 deletion src/WorkWeek.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'

import Week from './Week'
import TimeGrid from './TimeGrid'
Expand Down
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import * as dates from '../../utils/dates'
import { findDOMNode } from 'react-dom'

Expand Down
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/EventWrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import clsx from 'clsx'
import { accessor } from '../../utils/propTypes'
import { accessor as get } from '../../utils/accessors'
Expand Down
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/WeekWrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import * as dates from '../../utils/dates'
import { getSlotAtX, pointInBox } from '../../utils/selection'
import { findDOMNode } from 'react-dom'
Expand Down
2 changes: 1 addition & 1 deletion src/addons/dragAndDrop/withDragAndDrop.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React from 'react'
import * as React from 'react'
import clsx from 'clsx'

import { accessor } from '../../utils/propTypes'
Expand Down
2 changes: 1 addition & 1 deletion stories/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'

import moment from 'moment'
import React from 'react'
import * as React from 'react'

import '../src/sass/styles.scss'
import '../src/addons/dragAndDrop/styles.scss'
Expand Down
2 changes: 1 addition & 1 deletion stories/DragAndDrop.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'

Expand Down
2 changes: 1 addition & 1 deletion stories/Durations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import moment from 'moment'

Expand Down
2 changes: 1 addition & 1 deletion stories/Layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import moment from 'moment'

Expand Down
2 changes: 1 addition & 1 deletion stories/Resources.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { storiesOf } from '@storybook/react'

import { DragableCalendar } from './helpers'
Expand Down
2 changes: 1 addition & 1 deletion stories/Timeslots.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import moment from 'moment'
import React from 'react'
import * as React from 'react'

import { events, Calendar } from './helpers'
/* eslint-disable react/prop-types */
Expand Down
2 changes: 1 addition & 1 deletion stories/helpers/customComponents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import * as React from 'react'
import { action } from '@storybook/addon-actions'

const customComponents = {
Expand Down
2 changes: 1 addition & 1 deletion stories/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { addDecorator } from '@storybook/react'
import { action } from '@storybook/addon-actions'

import moment from 'moment'
import React from 'react'
import * as React from 'react'

import { Calendar as BaseCalendar, momentLocalizer } from '../../src'

Expand Down

0 comments on commit 1f799b3

Please sign in to comment.