question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird inconsistent behaviour with dynamics value

See original GitHub issue

Codesandbox link: https://codesandbox.io/s/p2wljkm9zm

In this example you can see

const styles = () =>
  createStyles({
    text: {
      backgroundColor: "red", // WORKING
      color: () => "blue", // WORKING
      "&:hover": {
        marginLeft: 20, // WORKING,
        marginRight: () => 20 // WORKING,
      }
    },
    someText: () => ({
      backgroundColor: "red", // WORKING
      color: () => "blue", // NOT WORKING
      "&:hover": {
        marginLeft: 20, // WORKING, 
        marginRight: () => 20 // WORKING,
      }
    }),
    otherText: {
      backgroundColor: "red", // WORKING
      color: () => "blue", // WORKING
      "&:hover": () => ({
        marginLeft: 20, // NOT WORKING,
        marginRight: () => 20 // NOT WORKING,
      })
    },
    finalText: () => ({
      backgroundColor: "red", // WORKING
      color: () => "blue", // NOT WORKING
      "&:hover": () => ({
        marginLeft: 20, // WORKING,
        marginRight: () => 20 // NOT WORKING,
      })
    })
  });

I understand the fact function inside function does not work, like color of someText, but in this case why marginRight of someText does work ? And why marginLeft of otherText does not work ? Even weirder, it works for finalText…

If it works when it shouldn’t at least it’s not a big deal. But I think the case of marginLeft of otherText should be a correct one, and actually it doesn’t work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kofcommented, Mar 15, 2019

We are not supporting value functions inside of rule functions, it just worked by accident I think.

0reactions
kofcommented, Mar 15, 2020

released in 10.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent behaviour with dynamics when creating parts ...
I created score, with two voices. I want to create parts, each voice would be separate part. Hairpins are reproduced to both voices....
Read more >
Inconsistent behavior in Automapper - Stack Overflow
Very strange thing happened in my project, i have a pretty simple CLR objects, First one is the Model other is ViewModel ,...
Read more >
Inconsistent Behavior of Liquid in the Custom JavaScript ...
Upon further inspection, I noticed that I could see my Liquid syntax in the source of the webpage – which is strange because...
Read more >
Dynamic inconsistency - Wikipedia
In economics, dynamic inconsistency or time inconsistency is a situation in which a decision-maker's preferences change over time in such a way that...
Read more >
Inconsistent people search in Office 365 - Microsoft Community
With this odd behavior of the People search when using the All search, it's become difficult ... Office 365 value every customer's thoughts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found