Skip to content

Remove unnecessary export of Heading type #32

@MohamadSalman11

Description

@MohamadSalman11

Before You Submit

Describe the issue

In the useHeadings hook, the Heading interface was exported but not used anywhere outside the hook.
We can safely remove the export keyword.

Current:

import { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';

const HEADING_H2 = 'H2';
const HEADING_H3 = 'H3';
const HEADING_DEFAULT_TITLE = 'Unknown';

export interface HeadingItem {
  id: string;
  title: string;
}

export interface Heading {
  id: string;
  title: string;
  items: HeadingItem[];
}

export const useHeadings = () => {
...
}

After:

import { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';

const HEADING_H2 = 'H2';
const HEADING_H3 = 'H3';
const HEADING_DEFAULT_TITLE = 'Unknown';

interface Heading {
  id: string;
  title: string;
  items: HeadingItem[];
}

export interface HeadingItem {
  id: string;
  title: string;
}

export const useHeadings = () => {
  ...
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions