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 :: React & TypeScript Chrome Extension Development [2021] 
Typescript :: typescript function example array arg 
Typescript :: Check restore percentage tsql 
Typescript :: Function to generate random number (typescript) 
Typescript :: typescript enum to string 
Typescript :: react router dom private route typescript 
Typescript :: import openzeppelin contracts in remix 
Typescript :: how to check if a string is composed only of alphabets in python 
Typescript :: typescript function return array 
Typescript :: typescript object key enum 
Typescript :: Pip install requirements txt not found 
Typescript :: declare jquery in typescript 
Typescript :: list of lists python 
Typescript :: woocommerce change related products tect 
Typescript :: How to compare two lists and return the number of times they match at each index in python 
Typescript :: gitlab where are artifacts stored 
Typescript :: sorting a vector of objects c++ 
Typescript :: emotion/css 
Typescript :: laravel unique working with softdeletes 
Typescript :: basic tsconfig file 
Typescript :: extend typescript 
Typescript :: ionic cannot be loaded because running scripts is disabled on this system. vscode 
Typescript :: remove single line comments regex 
Typescript :: how to react typescript callback function¨ 
Typescript :: google sheets countif two conditions 
Typescript :: wherein typeorm 
Typescript :: typescript pass a function as an argunetn 
Typescript :: filter() array of objects on change react 
Typescript :: how to find specific elements from a list in java 
Typescript :: typescript dynamic dict 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =