victory icon indicating copy to clipboard operation
victory copied to clipboard

Remove defaultProps from class components

Open carbonrobot opened this issue 1 year ago • 1 comments

Remove deprecated defaultProps from the following components

  • [ ] VictoryZoomContainer
  • [ ] VictoryVoronoiContainer
  • [ ] VictoryVoronoi
  • [ ] VictoryTooltip
  • [ ] VictoryArea
  • [ ] VictoryAxis
  • [ ] VictoryBar
  • [ ] VictoryBoxPlot
  • [ ] VictoryBrushContainer
  • [ ] VictoryBrushLine
  • [ ] VictoryCandlestick
  • [ ] VictoryAccessibleGroups
  • [ ] VictoryAnimation
  • [ ] VictoryClipContainer
  • [ ] VictoryContainer
  • [ ] VictoryPortal
  • [ ] VictoryCursorContainer
  • [ ] VictoryErrorBar
  • [ ] VictoryHistogram
  • [ ] VictoryLegend
  • [ ] VictoryLine
  • [ ] VictoryScatter
  • [ ] VictoryPolarAxis

carbonrobot avatar Dec 21 '23 17:12 carbonrobot

I think we are safe to keep using defaultProps in class components, I have only seen references to them being deprecated for function components:

  • Original RFC: https://github.com/reactjs/rfcs/commit/c71cb88b0badbe9119e1399688ee481e62da142b
  • React PR: https://github.com/facebook/react/pull/25699
  • ESLint PR: https://github.com/jsx-eslint/eslint-plugin-react/issues/2396

Tested the original Victory issue https://github.com/FormidableLabs/victory/issues/2656 with the latest version (36.8.1) and the changes in https://github.com/FormidableLabs/victory/pull/2679 seem to have fixed all of the warnings: Screenshot 2024-01-10 at 10 54 03

KenanYusuf avatar Jan 10 '24 11:01 KenanYusuf