Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

v1.0.0-beta/react-resval #4

Merged
merged 28 commits into from
Sep 25, 2022
Merged

v1.0.0-beta/react-resval #4

merged 28 commits into from
Sep 25, 2022

Conversation

nurulakbaral
Copy link
Owner

React Resval v1.0.0-beta

What's going on here?

First of all I realize that for React Resval version v0.1.0 there are some flaws in the abstraction is more or less not modular and redundant. So I tried to abstract again to be more modular in version v1.0.0.

v0.1.0

export function Component() {

  // There was repeated use of hooks.
  const fontSize = useVx({ base: '12px', md: '24px' })
  const color = useVx({ base: 'red', '600px': 'blue', lg: 'black' })

  return (
    <div>
      <h1 style={{ fontSize, color }}>Hello World!</h1>
    </div>
  )
}

v1.0.0

export function Component() {

  const { fontSize, color } = useVx({
    fontSize: { base: '12px', md: '24px' },
    color: { base: 'red', '600px': 'blue', lg: 'black' }
  })

  return (
    <div>
      <h1 style={{ fontSize, color }}>Hello World!</h1>
    </div>
  )
}

@nurulakbaral nurulakbaral self-assigned this Sep 25, 2022
@nurulakbaral nurulakbaral added the enhancement New feature or request label Sep 25, 2022
@nurulakbaral nurulakbaral merged commit b95f9e7 into main Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant