Skip to content

Commit

Permalink
fix: wrong Dynamic import statement
Browse files Browse the repository at this point in the history
  • Loading branch information
winjeysong authored and atilafassina committed Apr 27, 2024
1 parent b5cf127 commit c228e18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/routes/concepts/control-flow/dynamic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ order: 2
By passing either a string representing a [native HTML element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) or a component function to the `component` prop, you can render the chosen component with the remaining props you provide.

```jsx
import { createSignal, Dynamic, For } from "solid-js"
import { createSignal, For } from "solid-js"
import { Dynamic } from "solid-js/web"

const RedDiv = () => <div style="color: red">Red</div>
const GreenDiv = () => <div style="color: green">Green</div>
Expand Down Expand Up @@ -91,11 +92,11 @@ When working with these components, you can pass [props](/concepts/components/pr
This makes them available to the component you are rendering, similar to how you would pass props to components in JSX.

```jsx
import { Dynamic } from "solid-js"
import { Dynamic } from "solid-js/web"

function App() {
return (
<Dynamic component={someComponent} someProp="someValue" />
)
}
```
```

0 comments on commit c228e18

Please sign in to comment.