Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No auto suggestions on stylesheet properties #11

Closed
monarcode opened this issue Oct 5, 2023 · 3 comments
Closed

No auto suggestions on stylesheet properties #11

monarcode opened this issue Oct 5, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@monarcode
Copy link

monarcode commented Oct 5, 2023

Observation
When creating styles using the native Stylesheet, I get hints as I type for properties e.g fontFamily, color, etc! As seen in the image below
image

How ever, when creating styles using createStyles, I either only get suggestions for the first property only or none at all(see image below)
image

Environment
Node version: v18.15.0
Operating system: MacOS Sonoma
Editor: VSCode
Unistyles version: ^1.0.0-beta.1
Framework: Expo + typescript (expo router)

File structure


//styles.ts

import { breakpoints } from "constants/breakpoints";
import { theme } from "constants/theme";
import { createUnistyles } from "react-native-unistyles";

export const { useStyles, createStyles } = createUnistyles<
  typeof breakpoints,
  typeof theme
>(breakpoints);

export { theme };

// example usage

import { Text, View } from "components/base";
import { createStyles, useStyles } from "libs/styles";

export default function TabOneScreen() {
  const { styles } = useStyles(styleSheet);

  return (
    <View style={styles.container}>
      <Text style={styles.title}>Tab One</Text>
    </View>
  );
}

const styleSheet = createStyles((theme) => ({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
    backgroundColor: theme.colors.light,
  },
  title: {
    fontSize: 42,
    color: "black",
  }
}));

@atanaskanchev
Copy link

+1 on that, can replicate

@jpudysz
Copy link
Owner

jpudysz commented Oct 5, 2023

I'm working on it at the momement 😄

@jpudysz jpudysz added the bug Something isn't working label Oct 5, 2023
@jpudysz
Copy link
Owner

jpudysz commented Oct 6, 2023

Fixed with #12 !

@jpudysz jpudysz closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants