mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-05 23:43:37 +02:00
refact: convert components to use React.FC type + type improvements
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
d61c218657
commit
1d88367645
@@ -3,7 +3,7 @@ import "prismjs/components/prism-markup-templating"
|
||||
import "prismjs/components/prism-php"
|
||||
import "prismjs/components/prism-python"
|
||||
import "prismjs/plugins/line-numbers/prism-line-numbers.css"
|
||||
import React from "react"
|
||||
import React, { FC, useEffect } from "react"
|
||||
import * as SC from "./styles"
|
||||
|
||||
interface IMarkdownProps {
|
||||
@@ -14,11 +14,11 @@ interface IMarkdownProps {
|
||||
This component is used as a wrapper around Markdown generated content,
|
||||
mainly to provide styles to the html generated.
|
||||
*/
|
||||
export function Markdown({
|
||||
export const Markdown: FC<IMarkdownProps> = ({
|
||||
content,
|
||||
...restProps
|
||||
}: IMarkdownProps): JSX.Element {
|
||||
React.useEffect(() => {
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
Prism.highlightAll()
|
||||
}, [])
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user