コンポーネント分離

standaloneをつければできる

const Line = () => {
  return (
    <VictoryLine
      standalone={false}
      data={[
        { x: 1, y: 1 },
        { x: 100, y: 100 },
      ]}
    />
  )
}

export const ChartSandbox = () => {
  return (
    <VictoryChart>
      <Line />
    </VictoryChart>
  )
}

ただ、domainなど色々ぶっこわれがち

const line = () => {
  return (
    <VictoryLine
      standalone={false}
      data={[
        { x: 1, y: 1 },
        { x: 100, y: 100 },
      ]}
    />
  )
}

export const ChartSandbox = () => {
  return (
    <VictoryChart>
      {line()}
    </VictoryChart>
  )
}

このほうが楽