Skip to content

Commit

Permalink
refactor: Update MDX import to use next-mdx-remote-client and streaml…
Browse files Browse the repository at this point in the history
…ine element creation

- Replaced import of MDXRemote from 'next-mdx-remote' to 'next-mdx-remote-client'.
- Changed React.createElement to createElement for improved readability.
  • Loading branch information
kWAYTV committed Dec 4, 2024
1 parent e7338cd commit d8e04d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/core/blog/mdx.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';
import { MDXRemote } from 'next-mdx-remote/rsc';
import { MDXRemote } from 'next-mdx-remote-client/rsc';
import { Link } from 'next-view-transitions';
import React from 'react';
import { createElement } from 'react';
import { highlight } from 'sugar-high';

function Table({ data }) {
Expand Down Expand Up @@ -67,11 +67,11 @@ function slugify(str) {
function createHeading(level) {
const Heading = ({ children }) => {
const slug = slugify(children);
return React.createElement(
return createElement(
`h${level}`,
{ id: slug },
[
React.createElement('a', {
createElement('a', {
href: `#${slug}`,
key: `link-${slug}`,
className: 'anchor'
Expand Down

0 comments on commit d8e04d5

Please sign in to comment.