Khan / Khan/aphrodite

Calling set state and optionally setting styles isn't working

Open
#236 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.3k
Forks
187
PR merge metrics
No merged PRs in 30d

Description

Currently I am setting styles in my CRA app using a ternary operator.

The classes set properly, I can see the styles in the style tag but for whatever reason they do not apply.

This is what I have:
className={ css(this.state.fixed ? style.navContainerFixed : style.navContainer)

It is very similar to what is happening in the example here:
https://github.com/Khan/aphrodite/blob/master/examples/src/StyleTester.js#L37

image

Thanks in advance everyone.

Could this be similar to #76?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Aphrodite example in StyleTester.js and compare its conditional css(...) call with the reported CRA usage. Reproduce the missing visual styles and trace the state update, generated classes, and style application; done means the selected conditional style visibly applies.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.