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

75
Views
Destructured imports vs namespace in react libraries using typescript

My question is : is there any consequences in performance if using for example:

import * as Reanimated from 'react-native-reanimated'

Instead of :

import { useSharedValue, useAnimatedStyle, withspring, interpolate, Extrapolate } from 'react-native-reanimated'

Will react load all the library when using namespace ? Is there any différence when testing in thé two approaches ?

almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Import on-demand individual components or utils:

Here is the example of antd

Example:

import Button from 'antd/es/button'; 
import { Button } from 'antd'; // Imports all library

Here is another example of lodash. Only load required utils.

Example:

import assignIn from 'lodash/assignin';
import isPlainObject from 'lodash/isplainobject';
import isFunction from 'lodash/isfunction';
almost 4 years ago · Santiago Trujillo 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!