Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

Failed prop type: The prop `startDateId` is marked as required in `withStyles(DateRangePicker)`, but its value is `undefined`.

// regarding about this error
// Failed prop type: The prop `startDateId` is marked as required in 
// `withStyles(DateRangePicker)`, but its value is `undefined`.

// ctto @majapw from https://github.com/
// startDateId and endDateId are required props on the component (this is recent). 
// We updated this behavior to have parity with the SingleDatePicker and for accessibility reasons. 
// If you add id props on your DateRangePicker you should see the warning go away.

<DateRangePicker 
          startDateId="MyDatePicker" //--> add this
          startDate={this.props.filters.startDate}
          endDateId="MyDatePicker" //--> add this
          endDate={this.props.filters.endDate}
          onDatesChange={this.onDatesChange}
          focusedInput={this.state.calendarFocused}
          onFocusChange={this.onFocusChange}
          showClearDates={true}
          numberOfMonths={1}
          isOutsideRange={() => false}
        />
Comment

warning: failed prop type: the prop `history` is marked as required in `router`, but its value is `undefined`.

// regarding this error 
// warning: failed prop type: the prop `history` is marked as required in
// `router`, but its value is `undefined`.
// If you are using react-router v4 you need to install react-router-dom.
// After that, import BrowserRouter from react-router-dom and switch Router for BrowserRouter.
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom'
import App from './components/App';

ReactDOM.render((
     <BrowserRouter>
          <Route path="/" component={App}/>
     </BrowserRouter>
     ),
     document.getElementById('root')
);
// source https://stackoverflow.com/questions/43008036/the-prop-history-is-marked-as-required-in-router-but-its-value-is-undefine


// if you're using react router latest v6
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";

ReactDOM.render(
  <BrowserRouter>
    {/* The rest of your app goes here */}
  </BrowserRouter>,
  root
);
// source https://reactrouter.com/docs/en/v6/routers/browser-router
Comment

PREVIOUS NEXT
Code Example
Typescript :: how to delete unused imports intellij webstorm 
Typescript :: Do not use BuildContexts across async gaps. 
Typescript :: mark occurances of elements in array cpp 
Typescript :: react-router-dom for typescript 
Typescript :: typescript promise 
Typescript :: typescript object to array 
Typescript :: typescript type array of interface 
Typescript :: typescript get type 
Typescript :: check if graphic driver exists ubuntu 
Typescript :: NullInjectorError: R3InjectorError(DynamicTestModule)[AdminTestCentersComponent - ToastrService - InjectionToken ToastConfig - InjectionToken ToastConfig]: NullInjectorError: No provider for InjectionToken ToastConfig! 
Typescript :: adding two lists using lambda function 
Typescript :: draw image in html canvas 
Typescript :: angular rxjs mergemap 
Typescript :: typescript api request header 
Typescript :: ganache 
Typescript :: indexable type in ts 
Typescript :: plot multiple plots in r 
Typescript :: subplots in for loop python 
Typescript :: chevrons or angle brackets latex 
Typescript :: mailto multiple recipients to cc 
Typescript :: get one property from list of objects linq 
Typescript :: how to add multiple arguments in discord commands rewrite 
Typescript :: serenity.is hide form field 
Typescript :: getstaticpaths errors after new posts 
Typescript :: native base 
Typescript :: angular no internet detection 
Typescript :: O arquivo yarn.ps1 não pode ser carregado porque a execução de scripts foi desabilitada neste sistema 
Typescript :: difference between facets and filters algolia 
Typescript :: how to load events from an api in table_calendar flutter flutter 
Typescript :: Pass parameter to NestJs Guard 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =