6

What is happening

I just realised my answer was being wrongly rendered. The title is rendered as ### title and not in the correct format.

Result

I went to edit it, but the preview shows it the way I was expecting. Saving it doesn't change anything.

Editing the answer


Reproducible here


1. (Stopped working) Use function as useEffect callback

useEffect(fetchBusinesses, [])

### 2. Declare function inside `useEffect()`
useEffect(() => {
  function fetchBusinesses() {
    ...
  }
  fetchBusinesses()
}, [])

Expected behavior

The Preview should be the same as the end result. And the end result should render correctly.

There is one question for a similar issue, but what fixed that doesn't fix this one (I tried editing the post and saving again). Final answer rendering is different in the editor preview

1
  • You have a steady hand for those circles ...
    – rene
    Commented Dec 31, 2021 at 13:16

1 Answer 1

4

Issue - There are (2) whitespace characters above the header:


### 2. Declare function inside `useEffect()`

Suggestion - No whitespace characters above the header:


2. Declare function inside useEffect()


Note: As detailed in the question, this is currently a bug in the preview that shows both the above in the expected format however the live page does not render the heading with whitespace above. Here is a GIF for clarification and future reference:

1

3
  • 1
    Nevertheless, the preview should show the same as the final display.
    – BDL
    Commented Dec 29, 2021 at 17:06
  • @BDL: Yes! It's a bug just like when creating a Table without a blank line above; just wanted to point out why the issue only seemed to be in 2. but not 1.
    – Nimantha
    Commented Dec 29, 2021 at 17:15
  • 1
    True, the preview should be the same, but this solves the display error, thanks =D
    – jpenna
    Commented Dec 30, 2021 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .