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

209
Views
Al importar el espacio de trabajo, en mi ejemplo está en shared/components/Header.js, al escribir al final 'exportar por defecto' dice 'escriba cualquier' error

Uso espacios de trabajo de hilo y tengo 3 paquetes: aplicación, aplicación de electrones que usa reaccionar y compartido para todas las cosas comunes. Al importar compartido en la aplicación o electron, dice ese error en vscode: error

no se que hacer :/ probe de todo. y los archivos no son ts, sino js.

 import { View, StyleSheet, Text } from 'react-native'; import Header from 'shared/components/Header'; //const socket = new Socket("192.168.1.146", 8080, "http"); (async () => { //await socket.connect(); })(); const styles = StyleSheet.create({ screenContainer: { flex: 1 }, text: { fontSize: 20, color: 'cornflowerblue', marginTop: 50, alignSelf: 'center' } }); const App = () => { /*useEffect(() => { if (socket.getSocket() != undefined && socket.getSocket().connected) { socket.getSocket().disconnect(); } });*/ return ( <View styles={styles.screenContainer}> <Header /> <Text style={styles.text}>I'm a React Native component</Text> </View> ); }; export default App;
 import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; const styles = StyleSheet.create({ header: { paddingTop: 50, backgroundColor: 'red' }, headerText: { fontSize: 22, color: 'white', fontWeight: 'bold', paddingHorizontal: 10 } }); const Header = () => { return ( <View style={styles.header}> <Text style={styles.headerText}>I'm a shared component.</Text> </View> ); }; export default Header;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

crear fallback.d.ts con contenido:

 declare module '*';

E inclúyalo en su tsconfig.json https://www.typescriptlang.org/tsconfig#include (ruta al archivo d.ts relativa a la ruta tsconfig.json)

 { "include": ["./fallback.d.ts", ...], ... }

Esto le permitirá importar desde archivos js .

Pero en mi opinión, mejor sería convertir el archivo Header.js a typescript

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!