You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

useShapesToRender.ts 432B

1234567891011121314
  1. import { useSelector } from 'state'
  2. import { getShapeUtils } from 'state/shape-utils'
  3. import { deepCompareArrays } from 'utils'
  4. import tld from 'utils/tld'
  5. export default function useShapesToRender(): string[] {
  6. return useSelector(
  7. (s) =>
  8. Object.values(tld.getPage(s.data).shapes)
  9. .filter((shape) => shape && !getShapeUtils(shape).isForeignObject)
  10. .map((shape) => shape.id),
  11. deepCompareArrays
  12. )
  13. }