Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
How to handle urls with nextjs and chakra-ui?

When we use react linkify directly with chakra-ui (eg.Text) components, we cannot handle the link.

Problematic use case

import Linkify from 'react-linkify';
import {Box, Text} from '@chakra-ui/react';

export default function Usage(){

return (
 <Linkify>
  <Text>https://stackoverflow.com</Text>
 </Linkify>
);

};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solution is;

Create Linkify.js

Linkify.js file:

import { Link } from '@chakra-ui/react';
import ReactLinkify from 'react-linkify';

const componentDecorator = (href, text, key) => (
  <Link
    href={href}
    key={key}
    isExternal={true}
    color="blue.500"
    _focus={{ outline: 'none' }}
  >
    {text}
  </Link>
);

export const Linkify = (props) => {
  return <ReactLinkify {...props} componentDecorator={componentDecorator} />; };

Import new Linkify Component to the file.

Usage

import { Linkify } from './Linkify';
import { Text } from '@chakra-ui/react';

export default function Usage(){
 return(
 <Linkify>
  <Text>https://stackoverflow.com</Text>
 </Linkify>
 )
}

Problem Solved! Thanks...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!